Hello Everyone,
As the Title of my post states, I am currently creating a R shiny dashboard and when I create a new variable (i.e. renaming a previous df that I now have filtered), R shiny is not finding the new variable and then reporting a "argument is of length zero" error.
I know that the code itself is correct because if I take that new variable separately and run it in a different R sheet, it works well and the variable is correctly added to the global environment.
However, like I said, in the R shiny dashboard code these new variables are not being added to the global environment.
Any help on this topic would be awesome! I really appreciate the help!
Thank you so much for the help! Can you clarify the issue for me using the example I provide? This is part of my server function. The "filtereddata1" variable is not being recognized.
server <- function(session, input, output) { output$plot1 <- renderPlot({
filtereddata1 <- filter(mergedTrainingdf, Date >= input$daterange[1] & Date <= input$daterange[2]) %>%
filter(Team == input$Teaminput)
if (input$category == "Player") {filterdata1 <- filtereddata1 %>%
filter(Playername %in% input$Playernameinput)
}
if (input$category == "Overview") {filtereddata1 <- filtereddata1
}
ggplot(filtereddata1, aes(x= Date, y = Weight)) +
geom_point(size=2)
})
}
Thanks a lot for the help. Spelling mistakes are not ideal...
However, even when fixing that, it still doesn't work.
I have had this problem a couple of times with my project. This project has two csv files that are inputted at the beginning of the code. csv file1 loaded correctly, however, I had the same issue where csv file 2 was not put into the global environment until I ran it in a different R file tab.