R - copy files from folder (Shiny App)

25 views
Skip to first unread message

Wetcoaster

unread,
Sep 3, 2015, 1:00:15 AM9/3/15
to Shiny - Web Framework for R

I'm working on loading up a Shiny App IO. I use an R package that downloads data into a subfolder in my directory and saves two .RData files.


I'm having issues on the Shiny App IO server. I need to load the two .RData files. Locally, I can set the relative path using (~project/source-data). Shiny App does not respond to this.


I can set it as a working directory using a relative path, (./source-data), however, this is not ideal as I have further data manipulation to do at the parent level directory and I can't seem to set the working directory back to the parent level in Shiny App.


Here is what I had moved forward with:

wd = getwd() sd = (paste(getwd(),"/source-data",sep="")) sd2 = list.files(sd, full.names = TRUE) file.copy(from=sd2, to=wd)



My solution, although not ideal, is to copy the two .RData files to the parent directory. At that point, the rest of my code will run smoothly. It works locally, but not on Shiny App.


Does anyone have experience with a similar problem and solution? Either helping me direct the Shiny App IO server to the sub-directory and back to the parent directory once I load in the two .RData files, or copying the files to the parent directory?


I've seen solutions that work on a local R environment, but not one that satisfies the conditions of a Shiny App IO server environment.


I asked on SO and a user suggested it's possible that there are restrictions on copying files. Is this true, and is there a workaround?


Thank you in advance.

Reply all
Reply to author
Forward
0 new messages