COPY is name of my data frame (libor interest rates fred st.lious), see the picture attached or link below image. Year (COPY[,14]) column is numeric, Earlier I tried working with date type but that didn't work either.
[Click to get the raw data CSV file, and full code to get COPY dataset] (https://drive.google.com/drive/folders/1ZeSqUNfPeqkmGeVdQ_7xRTibSFKYKZmT?usp=sharing)
[DataFrame Head][1]
htmlDiv(list(
dccRangeSlider(
id = 'slider_2',min = min(unique(COPY[,14])),max = max(unique(COPY[,14])),
marks = unique(COPY[,14]),value = list(1987,2000) ),
style = list(width = '90%',margin= "auto"))),
##Histogram based on date-range obtained from slider
htmlDiv(list(
dccGraph(
id='basic-interactions_11', style = list( width= '90%',margin= "auto")))),
##Callback to filter my data on the date range obtained from slider input
)
app$callback(
output=list(id='basic-interactions_11', property='figure'),
params=list(input(id='slider_2', property='value')),
function(yea) {
COPY <- COPY[COPY$Year %in% yea, ]
traces = list(x=COPY[,2],name= '1 Month',type= 'histogram')
figure = list(list(data = traces))
return (figure)
}
)
[1]: https://i.stack.imgur.com/eGVvC.jpg