I have created a simple shiny app. The relevant code looks like this:
Server.R
library(shiny)
library(ggplot2)
shinyServer(function(input, output){
#Hier output je je plot, let op $myhist is iets wat je teruggeeft
output$myhist <- renderPlot({
df_graph <- df_test[df_test$playlist_name == input$var,]
#Dit is gewoon een normale graph aanmaken obv graph_data
g <- ggplot(df_graph, aes(x=key, y=value)) + geom_boxplot()
print(g)
})
})
UI.R
library(shiny)
shinyUI(fluidPage(
#maken sample data
#setwd("~/shiny_apps/echonest"),
df_test <- read.csv("df_echonest.csv", stringsAsFactors = F),
listIDs <- df_test$playlist_name,
#outlinen title
titlePanel(title = "This is the title"),
sidebarLayout(
sidebarPanel(
#Here you enter the var that you would like to use to filter the data shown in the graph
selectInput("var", "Select the eventID", choices = listIDs),
br(),
sliderInput("amount of fluctuation", "Integer:",
min=0, max=30, value=0)
),
mainPanel(("Personal information"),
plotOutput("myhist"))
)
))
All the relevant data that I need for running the app is stored in a .csv file that is also placed in the same folder and loaded using the following line in UI.R file:
df_test <- read.csv("df_echonest.csv", stringsAsFactors = F),
When I run it local it all works smooth. However when I try to deploy it using shiny and try to visit the relevant page (https://marcvanderpeet12.shinyapps.io/echonest/)I get the message:
Personal information Error: object 'df_test' not found
While the list actually loads (and that information also comes from df_test). Any thoughts where this goes wrong?