Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Saving Internet Files with Power BI Desktop.pq
#Define download file
URL <- ""
#Define Destination - use forward slash instead of back slash!
mainDir <- "c:/"
subDir <- "Power BI/"
subDir2 <- "Securities"
filename <- "issuers.csv/"
Destination <- paste(mainDir,subDir,subDir2, filename, sep="")
#Create Destination, if it does not exist
dir.create(file.path(mainDir, subDir), showWarnings = FALSE)
dir.create(file.path(mainDir, subDir, subDir2), showWarnings = FALSE)
#Download the file to destination
download.file(URL, destfile = Destination, method = "auto", quiet=FALSE)
# Read CSV into R
MyData <- read.csv(file=Destination, header=TRUE, sep=";")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment