Love all the help here so far, but having to teach myself R / Shiny, with no one in the office to help, I am unfortunately stuck again!!
I am trying to do checkboxgroups in Shiny. I read quite a bit, for example this, this, this, this and this already helped, but I am stuck now.
So my data set "ConversionsCompletions" looks now something like this :
date | goal1completions | goal
--------------------------------------------
01012016 | 4 | goal1
01012016 | 10 | goal2
01012016 | 8 | goal3
01012016 | 13 | goal4
02012016 | 6 | goal1
02012016 | 7 | goal2
.....
ui:
checkboxGroupInput("checkGroup", label = h3("Goal"),
choices = c("Goal 1" = "goal1",
"Goal 2" = "goal2",
"Goal 3" = "goal3",
"Goal 4" = "goal4",
"Goal 5" = "goal5",
"Goal 6" = "goal6",
"Goal 7" = "goal7"),
selected = "Goal 1")
plotlyOutput("Conversionrate1")
server:
filteredData <- reactive({
filter(ConversionsCompletions[ConversionsCompletions$goal %in% input$checkGroup,])
})
output$Conversionrate1 <- renderPlotly({
plot_ly(filteredData(), x = ConversionsCompletions$date, y = ConversionsCompletions$goal1Completions, mode = "lines + markers", hoverinfo = y)
})
There is a graph, but it doesn't change when I switch boxes, or shows more than one line at a time. I know usually you need to add the "add_trace" code for plotly charts, so I am not sure how to do it in this case when sometimes there is one line and sometimes multiple.
Any help appreciated!!