I am trying to download a CSV file into R that is hosted on the internet. The link to the file looks like this:
https://www12.some_website.ca/part1/part2/part3/part4/part5/download/comp/GetFile.cfm?Lang=E&FILETYPE=CSV&NO=016
Normally, I would use the "readr" library to download this file:
library(readr)
data <- read_csv("https://www12.some_website.ca/part1/part2/part3/part4/part5/download/comp/GetFile.cfm?Lang=E&FILETYPE=CSV&NO=016")
#loading message
indexed 39.19MB 0s in 13s, 2.93MB/s
However, I get this error:
Error in vroom_(file, delim = delim %||% col_types$delim, col_names = col_names, : 0s
embedded nul in string: 'PK\003\004\024'
I noticed that if I click the link directly https://www12.some_website.ca/part1/part2/part3/part4/part5/download/comp/GetFile.cfm?Lang=E&FILETYPE=CSV&NO=016
, this file automatically downloads a ZIP folder on to my computer and the CSV file is located in this folder:
C:\Users\myname\Downloads\the_zip_folder.zip
and the file itself is called: my_file.csv
.
- Is it somehow possible to directly download "my_file.csv" into R? Or is this not possible because the link I am using automatically downloads a folder?
Thanks!