简体   繁体   中英

load R Environment.RData for shiny server

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM