I have a zip file containing data in a private Github repo. I am writing some R code, and I wish to download the data into R. When I run the following code I get a HTTP status was '404 Not Found'. This doesn't happen when the repo is bublic, though.
How can I fix the code to be able to download the file? I believe I need to get a access token, but I don't know well how to get that either and add it to the code. If someone could help, I would appreciate a lot. Thanks.
# We give the url a name
url <- "https://github.com/aquijanoruiz/disability_benefits_EC/raw/master/ENSANUT_datasets/BDD_ENSANUT_2018_STATA_.zip"
# We create a temporary directory
td <- tempdir()
# We create the placeholder file
tf <- tempfile(tmpdir=td, fileext = ".zip")
# We download the data into the placeholder file
download.file(url,tf)