Load a .Rdata file into Shiny

1,984 views
Skip to first unread message

qians...@hotmail.com

unread,
Nov 5, 2013, 3:46:33 PM11/5/13
to shiny-...@googlegroups.com
Hello guys,

My app needs to use the data table stored in a .Rdata file. I already copy the .Rdata file into the directory /srv/shiny-server/myapp, my question is: suppose the data table is a data frame called 'mydata' and the file is test.Rdata, so in the server.R file, how can I load in test.Rdata so the app can use 'mydata' to do some calculation?

Thank you,

Su

Vincent Nijs

unread,
Nov 5, 2013, 4:00:10 PM11/5/13
to shiny-...@googlegroups.com
Try:

df <- load('mydata.Rdata')

df will be the name of the object in the Rdata file.

qians...@hotmail.com

unread,
Nov 5, 2013, 10:41:32 PM11/5/13
to shiny-...@googlegroups.com
Thank you Vincent, I will try it later

Ivan Gonzalez

unread,
Jan 26, 2017, 11:13:22 AM1/26/17
to Shiny - Web Framework for R
Hi! And in the case we have several ojects into de RData?

KZ KZ

unread,
Jan 26, 2017, 11:34:06 AM1/26/17
to Shiny - Web Framework for R
Hi!
You can do it like this:
a<-iris
b<-mtcars
save(a,b,file="test.Rdata")

load("test.Rdata")
head(a)
head(b)

четверг, 26 января 2017 г., 18:13:22 UTC+2 пользователь Ivan Gonzalez написал:
Reply all
Reply to author
Forward
0 new messages