I am creating a brilliant application and I need a subset of a DataFrame based on user input. I have tried many different ways to do this, but I constantly run into errors. Currently, this seems to be the easiest method, but I get the following error:
Warning in is.na (e2): is.na () applies to not (list or vector) of type "closure" Error in ==.default(test $ MARKET, var): comparison (1) is possible only for atomic and types of lists
I'm pretty stuck. Does anyone have any guidance for me? Thank!
library(shiny)
shinyServer(function(input, output) {
var <- reactive({input$var})
subsetTest <- subset(test, test$MARKET==var)
y <- subsetTest()$PRICE
x <- subsetTest()$DATE
output$ngplot <- renderPlot({
print(ggplot(data=subsetTest(), aes(x=y, y=x)) + geom_line())
})
})
source
share