I'm trying to prepare a boxplot that plots the plot based only on columns which are selected in the checkbox. The plot can be properly displayed for only one column (I can freely switch it), but after adding (checking) more than 1 column the plot collapses and the error occurs:
Error: id variables not found in data: Numer
That's my code of the checkbox section from the ui side:
h4("Checkbox"),
checkboxGroupInput(inputId = "zmienne",
label = "Columns:",
choices=c('L1','L2','L3','L4','L5','L6','L7','L8','L9','L10','L11','L12','L13','L14','L15','L16','L17','L18','L19','L20'),
selected = c('L1')
)
)
And from the server side:
output$plot <- renderPlot({
d <- dataIn()
d <- melt(d[,c((input$zmienne))],id.vars="Numer")
wyk <- (
ggplot(d,aes(x=input$zmienne,y=value))
+ geom_boxplot(fill = rgb(input$redid,0,1))
+ xlab("") + ylab("Kula")
)
return(wyk)
})
What may be the problem? Thanks for help.
Aucun commentaire:
Enregistrer un commentaire