I am doing monthly reports and would like to dynamically refresh the slider based on the year that I select from the drop down. My dataset ranges from years 2005 to 2015 and the slider is currently showing 2012 data. Two-fold question,How can I refresh the sliderInput to 2010 and how do I limit the Year dropdown control to only show the years on my dataset (2005 to 2015)? Below is the yaml and screenshot is attached.
title: "Salmon Program"
date: "`r format(Sys.Date())`"
output:
pdf_document:
toc: yes
toc_depth: '4'
html_document:
toc: yes
toc_depth: '4'
keep_md: yes
params:
glimpse: no
Runs:
label: Salmon Runs
value:
- Winter
- Spring
- Fall
- LateFall
input: select
choices:
- Winter
- Spring
- Fall
- LateFall
multiple: yes
Year: 2012
Dates:
input: slider
min: !r as.Date("2012-01-01") #Can this be dynamically changed based on the report dates?
max: !r as.Date("2012-12-31")
value: !r c(as.Date("2012-01-01"), as.Date("2012-01-30"))
step: 30