Over a million developers have joined DZone.

Download Files from Dropbox Programmatically with R

· Big Data Zone

Here is a usefull snippet that I stole from qdap::url_dl to download files from my Dropbox to the working directory. Argument x is the document name and d the document key. 

dl_from_dropbox <- function(x, key) {
                        bin <- getBinaryURL(paste0("https://dl.dropboxusercontent.com/s/", key, "/", x),
                                            ssl.verifypeer = FALSE)
                        con <- file(x, open = "wb")
                        writeBin(bin, con)
                        message(noquote(paste(x, "read into", getwd())))                        
# Example:
dl_from_dropbox("GViewer_Embeds.txt", "06fqlz6gswj80nj")

Published at DZone with permission of Kay Cichini , DZone MVB .

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}