Deploying and importing my own data (csv files) on shinyapps

131 views
Skip to first unread message

Duco

unread,
Feb 1, 2014, 2:40:21 PM2/1/14
to shinyap...@googlegroups.com
Hi!

Forgive me if this is straightforward.

I have succesfully ran my app locally with my own data in an .csv format in the appDir. I used:

  MyData<-read.table("MyData.csv", sep=" ",row.names=NULL)

Now I have deployed my app, but this does not work. My question: How can I include data in the deployment and 'import' it in the server file.

Best Regards,
Duco

Andy Kipp

unread,
Feb 3, 2014, 1:08:53 PM2/3/14
to shinyap...@googlegroups.com
Your data file(s) should be in the same directory as your application files (e.g. ui.R and server.R) it will automatically be deployed. 

Duco

unread,
Feb 5, 2014, 4:54:34 PM2/5/14
to shinyap...@googlegroups.com
The .csv file is in the same location as the application file. However, although the application imports the data when I run it locally, it does not import it when deployed. 

The UI is there, but there is just no data.

This is how I start my server.R file:

library(shiny)
shinyServer(function(input, output) {

  MyData<-read.table("MyData.csv", sep=" ",row.names=NULL)
    .....

I have also tried the read.csv command instead of read.table with no success. Furthermore using the sqldf package I converted the csv file to an sqlite file and imported it via 

  db <- dbConnect(SQLite(), dbname="MyData.sqlite")
  MyData<-dbGetQuery(db,"SELECT *  FROM table")

Also with no success. Any other suggestions?

Best Regards,
Duco

Scott Chamberlain

unread,
Feb 7, 2014, 10:45:14 AM2/7/14
to shinyap...@googlegroups.com
I wonder if how the path to a local file on shinyapps.io is specified, is it assumed that it's just "file.csv" without any path since it's in the same dir as ui.r and server.r?

Scott

Joe Cheng

unread,
Feb 7, 2014, 1:20:13 PM2/7/14
to Scott Chamberlain, shinyap...@googlegroups.com
Yeah, that's right.

Duco, is it possible you didn't get the case exactly right (e.g. MyData.csv vs. mydata.csv)? If you're using Windows locally, then case is ignored, but since ShinyApps is on Linux, case matters.


--
You received this message because you are subscribed to the Google Groups "ShinyApps Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/49245344-4f7e-4de3-b47c-85a68d880636%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Andy Kipp

unread,
Feb 11, 2014, 9:56:10 AM2/11/14
to shinyap...@googlegroups.com, Scott Chamberlain
I just wanted to follow up on this and the issue was local to Duco's computer. I guess some type of ad-blocker was preventing the plot from loading in the browser. This was *not* and issue with ShinyApps or Duco's code. I'll let him chime in if he wants to elaborate on what he did to correct the issue.

-Andy
Reply all
Reply to author
Forward
0 new messages