download a csv file using a https request with R -


i download csv file using https request. using web browser, can download file.

i in r. did try use geturl function rcurl package without success.

library(rcurl) url <-      "https://indices.euronext.com/nyx_eu_listings/price_chart/download_historical?typefile=csv&layout=vertical&typedate=dmy&separator=point&mic=xpar&isin=fr0003500008&name=cac%2040&namefile=price_data_historical&from=0&to=1426550400000&adjusted=1&base=0"  csvfile <- geturl(url) 

tks help

use download.file read.table instead of geturl:

url <- "https://indices.euronext.com/nyx_eu_listings/price_chart/download_historical?typefile=csv&layout=vertical&typedate=dmy&separator=point&mic=xpar&isin=fr0003500008&name=cac%2040&namefile=price_data_historical&from=0&to=1426550400000&adjusted=1&base=0"         download.file(url, "name.txt")         data.url <- read.table("name.txt", skip= 3, sep=",", header=true) 

you neep skip reading fist 3 rows. if need metadata information:

metadata <- read.table("name.txt", nrow=3)


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -