I have a server.R file in the following form:
server.R
shinyServer(
function(input, output, session) {
mydata<- reactive({
df<- dataframe1
variable1
variable2
list(df, variable1, variable2)
})
output$plot<- renderPlot({
p<-ggplot(mydata()$df, aes(y=V8, x = 1:nrow(mydata()$df), fill = V8))
print(p)
})
})
My issue is that the call to ggplot, while it seems to recognize mydata$df(), it returns the error
Error in nrow(mydata()$df) : could not find function "mydata".
I am not sure where my syntax is wrong. Can anyone shed some light? Thanks!