Applying read_csv() on certain data files produce this error:
Error in list(site_nbr = col_character(), sampdate = col_date(), param = 
col_character(),  :
  argument 6 is empty
In addition: Warning messages:
1: The following named parsers don't match the column names: param, unit 2: The following named parsers don't match the column names: site_nbr, sampdate, param, quant, unit 3: The following named parsers don't match the column names: site_nbr, sampdate, param, quant, unit

I don't see any argument 6.

My web searches for this error returned nothing relevant.

My syntax for other .csv files with different column titles don't generate
this error.

Here are the head of one data file and the read_csv() command to import it:
$ head upriv-chla.csv site_nbr,sampdate,param,quant,unit
10350,1989-07-18,chl-a,2.50,ug/l
10350,1989-08-16,chl-a,2.70,ug/l
10350,1989-09-20,chl-a,5.20,ug/l
10350,1990-05-30,chl-a,0.70,ug/l
10350,1990-06-26,chl-a,4.50,ug/l
10350,1990-07-17,chl-a,2.60,ug/l
10350,1990-08-20,chl-a,3.40,ug/l
10350,1990-09-18,chl-a,3.40,ug/l
10350,1991-07-08,chl-a,9.20,ug/l
10350,1991-10-07,chl-a,4.70,ug/l

upriv_chla <- read_csv("../data/geochem/upriv-chla.csv", col_names = TRUE,
                       col_types = list (
                           site_nbr = col_character(),
                           sampdate = col_date(format = "D"),
                           param = col_character(),
                           quant = col_double(),
                           unit = col_character()
                           ))

Note: I added the date format after seeing the error but that did not fix
the problem.

Running 'grep -axv '.*' upriv-chla.csv' to see if there are non-ASCII
characters in the file shows there aren't any.

I've no idea how to identify the source of this error beyond what I've done.

Suggestions needed.

Rich

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to