0

I want to download a csv file on R with readr::read_csv. These are the 9 columns for the header :

DATAFLOW,LAST UPDATE,freq,unit,coicop,geo,TIME_PERIOD,OBS_VALUE,OBS_FLAG

And these are the corresponding values for each column :

ESTAT:PRC_HICP_MIDX(1.0),19/04/23 11:00:00,M:Mensuel,"I15:Indice, 2015=100",CP01:Produits alimentaires et boissons non alcoolisées,"EA:Zone euro (EA11-1999, EA12-2001, EA13-2007, EA15-2008, EA16-2009, EA17-2011, EA18-2014, EA19-2015, EA20-2023)",1996-01,70.73,

Last week i had trouble downloading the data with the read.csv method because of the different commas in the columns (e.g : "I15:Indice, 2015=100" which is a data for one column). I tried with the readr::read_csv method and it solved my problem and downloaded perfectly the data in 9 columns, but today I tried to run my code again and it wasn't working do you know what could be the problem knowing I didn't change anything in the code neither in the database. And if you don't know why do you know what other method I could use to download the data correctly ?

Phil
  • 7,287
  • 3
  • 36
  • 66
EOST
  • 1
  • 2
  • Can you provide your data using `dput()` or `head(dput())` to give us a better sense of what your data looks like? – jrcalabrese May 02 '23 at 15:41
  • structure(list(DATAFLOW = c("ESTAT:PRC_HICP_MIDX(1.0),19/04/23 11:00:00,M:Mensuel,\"\"I15:Indice, 2015=100\"\",CP01:Produits alimentaires et boissons non alcoolisées,\"\"EA:Zone euro (EA11-1999, EA12-2001, EA13-2007, EA15-2008, EA16-2009, EA17-2011, EA18-2014, EA19-2015, EA20-2023)\"\",1996-01,70.73,\"\r", Here is the first line of my output with head(dput(df)) – EOST May 03 '23 at 09:32
  • Can you add the entire line to your original question and make a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)? – jrcalabrese May 03 '23 at 15:26

0 Answers0