vinsent paramanantham February 2016

Error in l$data : $ operator is invalid for atomic vectors shiny app

s[enter image description here][1]server.R
df <- read.csv("")
output$out1 <- renderUI({ 

    params <- colnames(df)

    # These are the colum names goes as a list into the selectInput..
    param_list <- params  

    # Dynamically create dropdown box
    selectInput("params", label = "Choose a variable to Observe", choices = param_list)
    # print(param_list)

})

stateDataSubset <- reactive({

    input$params
    dataSetVariable <- input$params

 })

I am trying to use the input$param which is dynamically created in another function at another reactive function, not sure why I am getting this error as similar code in the past has worked. params is there in output$out1, now I want that input in stateDataSubset function.

enter image description here

Answers


user5249203 February 2016

you need to provide proper example. Rather than just explaining users who have no idea of what you are trying to accomplish....Please provide input and seps of your code that lead to error. This explanation " created in another # function at another reactive function...." or saying " now I # want that input in stateDataSubset function." Which users have no idea will not be helpful.

And, to answer your error $ operator is invalid for atomic vectors, is self explained. You are trying to use $ to access a vector. to avoid that problem change whatever input is to a data.frame. Proper solution in code format could be provided only if you are able to explain your problem with example.

Post Status

Asked in February 2016
Viewed 1,413 times
Voted 8
Answered 1 times

Search




Leave an answer