I have created a sliderInput in UI.R
fluidRow(column(4,
uiOutput("showMapPlot"),
wellPanel(
sliderInput("slider", label = h4("Time (Hours)"), min = 1, max = 552, value = c(10,50),animate = FALSE, width="70%", format = "#")
), ...................
and I am passing the input$slider1 and input$slider[2] into server.R and where I am plotting some graphs using ggplot function.
The function is like below
plot_1 <- function() {
var = input$select
gg1 <- aggregate(cbind(get(var)) ~ Mi + hours , a, FUN=mean)
names(gg1)[3] <- var
print(ggplot(gg1, aes_string(x = "hours", y = var, group = "Mi")) +
geom_point(aes(color = factor(Mi))) + geom_smooth(stat= "smooth" , alpha = I(0.4), method="loess",color="grey", formula = y ~ x)
How to access the slider inputs from the UI.r and update in realtime with the server.R. I want to recursively change the x axis values according to the slider input values.
I know the dataset a in the expression
gg1 <- aggregate(cbind(get(var)) ~ Mi + hours , a, FUN=mean)
should alter somehow to access the data in the range of slider inputs. I dont know where should I implement it. I tried to update within this function itself and it did not work. I tied withing renderUI and there also it did not work, and mostly the method was wrong.
Please if someone knows the solution let me know.
The data is given below. https://drive.google.com/file/d/0B54s5NXDypdMRmdsSjZnMzd5VVE/edit?usp=sharing
and object a is created priori like "a <- read.table(file=file.choose(), header=FALSE,col.names= c("Ei","Mi","hours","Nphy","Cphy","CHLphy","Nhet","Chet","Ndet","Cdet","DON","DOC","DIN","DIC","AT","dCCHO","TEPC","Ncocco","Ccocco","CHLcocco","PICcocco","par","Temp","Sal","co2atm","u10","dicfl","co2ppm","co2mol","pH"))
"