Reputation: 696
I just hosted my first shiny app on a droplet web server and things appear to be only partially functional.
This is because the data that loaded into R on my PC when i developed the shiny app is not being read in to the Shiny app hosted on the server. The data is available in the form of an Environment.RData
file. This Environment.RData
file needs to be loaded into R for the shiny app to have access to all of the data needed.
I am struggling to add the correct line of code to load this Environment.RData
file.
I have tried some of the most obvious options (shown below) but without success...
#server.R
load("~/srv/shiny-server/Shiny_scRNASeq/R_Environment.RData")
load("R_Environment.RData")
source('R_Environment.RData', local=TRUE)
I have tried several iterations of similar commands but without success.
Does anyone know of another way to load this R_Environment.RData
file or do i need to go back and individually add the datasets used by the functions in the shiny app.
Thanks for your help!
Upvotes: 2
Views: 1577
Reputation: 2215
I've had success including my data as .rds files. First step was saving with saveRDS()
to data/
, and then loading in server.R
with asdf <- readRDS("data/asdfasdf.rds")
.
I'm not sure how to go about this with an Environment.RData
file, but this might get you what you need if there aren't too many objects to deal with.
Upvotes: 4