Referencing Column names - R shiny -
i building r shiny application , seem stuck seems minor issue. have tried various options , none of them seems work.
essentially, application users choose drop down. each value in drop down corresponds particular column in dataframe. depending on value selected, plot displayed depicting relationship between selected variable , output variable.
the ui side of code follows:
tabpanel("descriptive analysis", sidebarpanel( selectinput("inputvar", label ="select predictor", list("predictor1" = "pred1","predictor2" = "pred2")) ), mainpanel( plotoutput('descanalysis') ))
"pred1" , "pred2" column names in dataframe.
now on server side have following code:
output$descanalysis<-renderplot({ var<-input$inputvar tbl<-table(df$var,df$output) mosaicplot(tbl) })
but it's throwing error, following error message: 'x' must not have 0 dimensionality.
thanks!
Comments
Post a Comment