I need to make a data frame with data from a website that is from last 7 days. I used this code:
d <- readLines(paste(con="https://www.pse.pl/getcsv/-/export/csv/PL_GEN_WIATR/data_od/%22,format(Sys.Date()-7,%22%25Y%25m%25d%22),%22/data_do/%22,format(Sys.Date(),%22%25Y%25m%25d"), sep = ""))
writeLines(d,con="test.csv")
When I create data frame from this dataset, columns titles are stored in the first row and I need to put it higher.
I tried common
df <- data.frame(d)
But the same problem I wrote above appears.
then
df <- read.table(file="data/test.csv",sep=";",dec=",",header=T,stringsAsFactors=F)
but it seems that it's not saved as a file because R couldn't find the file.