Bryan Hanson
2011-May-20 18:05 UTC
[R] Downloading a csv from Dropbox using the shareable link
Hello Kindred R Spirits... I'm trying to get a file (csv) from Dropbox using their shareable link concept. They issue a short URL that goes to a web page where you see a button that says "Download File". They don't really give you the URL of the file itself, just this page. Is there a way to coax R into getting such a file? I don't even really want the file per se, I just want a path to the file so I can reference it for Sweave purposes and read the contents into an object. Seems like a job for RCurl but I have little experience and this seems like an odd case anyway. By the way, I want to do this as a way to have several people on different computers run a .Rnw file that needs to access common data set w/o changing the path to the file each time a different person opens the file and works on it. Perhaps there is another way of doing this. Thanks for any suggestions. Bryan **************** Prof. Bryan Hanson Dept of Chemistry & Biochemistry DePauw University Greencastle IN 46135 USA
Timothy Bates
2011-May-20 22:29 UTC
[R] Downloading a csv from Dropbox using the shareable link
The problem is that dropbox sharable links unpack to https URIs, and R doesn't support secture http (at least not on Mac, not sure about other platforms). Would be great to compile the read.table etc. functions to use curl when it is installed, as curl supports a myriad of protocols. Rcurl package seems to does this (but not on windows) http://cran.r-project.org/web/packages/RCurl/RCurl.pdf If your friends all use dropbox, they can get a common local path with something like "~Dropbox/file.Rnw" t On 20 May 2011, at 19:05, Bryan Hanson wrote:> Hello Kindred R Spirits... > > I'm trying to get a file (csv) from Dropbox using their shareable link concept. They issue a short URL that goes to a web page where you see a button that says "Download File". They don't really give you the URL of the file itself, just this page. Is there a way to coax R into getting such a file? I don't even really want the file per se, I just want a path to the file so I can reference it for Sweave purposes and read the contents into an object. Seems like a job for RCurl but I have little experience and this seems like an odd case anyway. > > By the way, I want to do this as a way to have several people on different computers run a .Rnw file that needs to access common data set w/o changing the path to the file each time a different person opens the file and works on it. Perhaps there is another way of doing this.
Patrick Connolly
2011-May-21 00:24 UTC
[R] Downloading a csv from Dropbox using the shareable link
On Fri, 20-May-2011 at 02:05PM -0400, Bryan Hanson wrote:> Hello Kindred R Spirits... > > I'm trying to get a file (csv) from Dropbox using their shareable link > concept. They issue a short URL that goes to a web page where you see a > button that says "Download File". They don't really give you the URL of > the file itself, just this page. Is there a way to coax R into getting > such a file? I don't even really want the file per se, I just want aDropbox allows you to share folders with other Dropbox users who would then have access to your file/s as a file/s on their individual computers. It would mean that any collaborator would have to have a Dropbox account and they'd all end up downloading the file. If there aren't too many for you to individually invite and it's not excessive bandwidth for them to download that many copies of the file, it would be easily done. (You might even get yourself some more diskspace on Dropbox by inviting other users.) You'd have to think about whose version has what effect on others but without knowing your objectives, it's impossible for me to say what's the best approach. HTH> path to the file so I can reference it for Sweave purposes and read the > contents into an object. Seems like a job for RCurl but I have little > experience and this seems like an odd case anyway. > > By the way, I want to do this as a way to have several people on > different computers run a .Rnw file that needs to access common data set > w/o changing the path to the file each time a different person opens the > file and works on it. Perhaps there is another way of doing this. > > Thanks for any suggestions. Bryan > **************** > Prof. Bryan Hanson > Dept of Chemistry & Biochemistry > DePauw University > Greencastle IN 46135 USA > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. ___ Patrick Connolly {~._.~} Great minds discuss ideas _( Y )_ Average minds discuss events (:_~*~_:) Small minds discuss people (_)-(_) ..... Eleanor Roosevelt ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
Bryan Hanson
2011-May-23 17:43 UTC
[R] Downloading a csv from Dropbox using the shareable link
Thanks Ian, not too late at all. I need to do some testing but your idea seems like it should work. Thanks, Bryan On May 23, 2011, at 12:44 PM, Ian Gow wrote:> This might be a little late, but one option for this issue might be > to add > a line like > Sys.setenv("DROPBOX_PATH" = "/Users/PersonA/Dropbox/") > to Person A's .Rprofile (on my Mac, this is in my home directory) > and the > equivalent (mutatis mutandis) to Person B's .Rprofile and then use > Sys.getenv("DROPBOX_PATH") > to access the path. It seems from looking at forums for Dropbox that > there > is no easily accessed environment variable that Dropbox sets for the > path > to the Dropbox folder. > > -- > Ian Gow > Accounting Information and Management > Kellogg School of Management > Northwestern University > 2001 Sheridan Rd, Rm 6229 > Evanston, IL 60208-2002 > Phone: +1-847-467-4508 > i-gow at kellogg.northwestern.edu > > [R] Downloading a csv from Dropbox using the shareable linkBryan > Hanson > hanson at depauw.edu > <mailto:r-help%40r-project.org?Subject=Re%3A%20%5BR%5D%20Downloading%20a%20 > csv%20from%20Dropbox%20using%20the%20shareable%20link&In-Reply-To= > %3C04D199 > AF-8868-4C5E-A47D-1A21C22D0508%40depauw.edu%3E> > Sat May 21 03:17:42 CEST 2011 > * Previous message: [R] Downloading a csv from Dropbox using the > shareable > link <https://stat.ethz.ch/pipermail/r-help/2011-May/278732.html> > * Next message: [R] Downloading a csv from Dropbox using the shareable > link <https://stat.ethz.ch/pipermail/r-help/2011-May/278749.html> > * Messages sorted by: [ date ] > <https://stat.ethz.ch/pipermail/r-help/2011-May/date.html#278733> > [ thread > ] <https://stat.ethz.ch/pipermail/r-help/2011-May/ > thread.html#278733> [ > subject ] > <https://stat.ethz.ch/pipermail/r-help/2011-May/subject.html#278733> [ > author ] > <https://stat.ethz.ch/pipermail/r-help/2011-May/author.html#278733> > > ________________________________________ > Hi Patrick, here is the set up: > > Everyone is already sharing all the files and has full access. We > have an Rnw file which generates a report and uses a csv file in a > "nearby" directory. Dropbox keeps it all sync'd. But, if Person A is > working on the file on their computer the path to the data would be > (Mac OSX) /Users/PersonA/Dropbox/Project/data.csv However, to Person > B the path would be /Users/PersonB/Dropbox/data.csv I'm looking for a > way to keep the path to data.csv universal and independent of who is > actually using the file. That's why I was looking at the "shareable > link" feature on Dropbox. > > I guess I see two solutions (partially answering my own question now). > > 1. Keep the data file in the same directory as the report and I don't > think there would be any problems. > 2. In the Rnw file, use a relative path. I know you can do this for > instance when you specify where the graphics go. I suppose the same > approach would allow me to specify the path as going up one level and > then down into a different directory. As long as I bury these folders > deep enough that I don't have to use a relative path that ever hits > the "PersonX" level I suppose it will work. > > I'll try it out. Further suggestions welcome. Thanks, Bryan > > On May 20, 2011, at 8:24 PM, Patrick Connolly wrote: > >> On Fri, 20-May-2011 at 02:05PM -0400, Bryan Hanson wrote: >>>> Hello Kindred R Spirits... >>>>> I'm trying to get a file (csv) from Dropbox using their shareable >>> link >>> concept. They issue a short URL that goes to a web page where you >>> see a >>> button that says "Download File". They don't really give you the >>> URL of >>> the file itself, just this page. Is there a way to coax R into >>> getting >>> such a file? I don't even really want the file per se, I just >>> want a >>> Dropbox allows you to share folders with other Dropbox users who >>> would >> then have access to your file/s as a file/s on their individual >> computers. It would mean that any collaborator would have to have a >> Dropbox account and they'd all end up downloading the file. If there >> aren't too many for you to individually invite and it's not excessive >> bandwidth for them to download that many copies of the file, it would >> be easily done. (You might even get yourself some more diskspace on >> Dropbox by inviting other users.) >>> You'd have to think about whose version has what effect on others >>> but >> without knowing your objectives, it's impossible for me to say what's >> the best approach. >>> HTH >>>>>> path to the file so I can reference it for Sweave purposes and >>>>>> read >>> the >>> contents into an object. Seems like a job for RCurl but I have >>> little >>> experience and this seems like an odd case anyway. >>>>> By the way, I want to do this as a way to have several people on >>> different computers run a .Rnw file that needs to access common >>> data set >>> w/o changing the path to the file each time a different person >>> opens the >>> file and works on it. Perhaps there is another way of doing this. >>>>> Thanks for any suggestions. Bryan >>> **************** >>> Prof. Bryan Hanson >>> Dept of Chemistry & Biochemistry >>> DePauw University >>> Greencastle IN 46135 USA >>>>> ______________________________________________ >>> R-help at r-project.org <https://stat.ethz.ch/mailman/listinfo/r-help >>> > >>> mailing list >>> https://stat.ethz.ch/mailman/listinfo/r-help>> PLEASE do read the >>> posting guide http://www.R-project.org/posting-guide.html>> and >>> provide >>> commented, minimal, self-contained, reproducible code. >>> -- >> ~ >> .~ >> .~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. >> ___ Patrick Connolly >> {~._.~} Great minds discuss ideas >> _( Y )_ Average minds discuss events >> (:_~*~_:) Small minds discuss people >> (_)-(_) ..... Eleanor Roosevelt >> >> ~ >> .~ >> .~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. > ________________________________________ > > * Previous message: [R] Downloading a csv from Dropbox using the > shareable > link <https://stat.ethz.ch/pipermail/r-help/2011-May/278732.html> > * Next message: [R] Downloading a csv from Dropbox using the shareable > link <https://stat.ethz.ch/pipermail/r-help/2011-May/278749.html> > * Messages sorted by: [ date ] > <https://stat.ethz.ch/pipermail/r-help/2011-May/date.html#278733> > [ thread > ] <https://stat.ethz.ch/pipermail/r-help/2011-May/ > thread.html#278733> [ > subject ] > <https://stat.ethz.ch/pipermail/r-help/2011-May/subject.html#278733> [ > author ] > <https://stat.ethz.ch/pipermail/r-help/2011-May/author.html#278733> > > ________________________________________ > More information about the R-help mailing list > <https://stat.ethz.ch/mailman/listinfo/r-help> >
Possibly Parallel Threads
- [PATCH] xen: arm32: Use system wide TLB flushes, not just inner-shareable
- [PATCH] lib: libvirt: stop using <shareable/> for appliance disk (RHBZ#1518517)
- OT: Dropbox - Fedora Core 9 RPM will work on CentOS 5.4?
- Thiago Avelino has invited you to Dropbox
- Still getting Dropbox warning at login after uninstalling Dropbox