Created
June 5, 2019 23:25
-
-
Save renato04/dc4755905bb54b1e0f380f157fb866e8 to your computer and use it in GitHub Desktop.
How to download a write a file using R?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
download = function(f){ | |
if(!file.exists('data')){ | |
dir.create('data') | |
} | |
file.local = file.path('./data', basename(f)) | |
if(!file.exists(file.local)){ | |
download.file(url = f, destfile = file.local , mode='wb') | |
} | |
} | |
download("https://raw.githubusercontent.com/elthonf/fiap-mba-r/master/data/Copas.csv") | |
download("https://raw.githubusercontent.com/elthonf/fiap-mba-r/master/data/Copas-Partidas.csv") | |
download("https://raw.githubusercontent.com/elthonf/fiap-mba-r/master/data/Copas-Jogadores.csv") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment