[R] Is 'temp' a reserved/key word in R?

Andrew Simmons @kw@|mmo @end|ng |rom gm@||@com
Tue Nov 30 15:36:36 CET 2021


It seems like the headers are misnamed, that should be a comma between
sampdate and param, not a period

On Tue, Nov 30, 2021, 09:35 Rich Shepard <rshepard using appl-ecosys.com> wrote:

> A short data file:
> site_nbr,sampdate.param,quant,unit
> 31731,2005-07-12,temp,19.7,oC
> 31731,2007-03-28,temp,9,oC
> 31731,2007-06-27,temp,18.3,oC
> 31731,2007-09-26,temp,15.8,oC
> 31731,2008-01-17,temp,5.4,oC
> 31731,2008-03-27,temp,7.4,oC
> 31731,2010-04-05,temp,8.1,oC
> 31731,2010-07-26,temp,20.5,oC
> 31731,2010-10-18,temp,12.5,oC
> 31731,2011-01-10,temp,5.4,oC
>
> The import function:
> sal_temp <- read_csv("../data/geochem/sal-temp.csv", col_names = TRUE,
>                       col_types = list (
>                           site_nbr = col_character(),
>                           sampdate = col_date(),
>                           param = col_character(),
>                           quant = col_double(),
>                           unit = col_character()
>                       ))
>
> The response from R:
> source('../scripts/test.r')
> Warning message:
> The following named parsers don't match the column names: sampdate, param
>
> I searched the web to see if 'temp' is causing the problem and didn't find
> an answer; my search term might have been flawed.
>
> If that string is a problem please suggest an alternative.
>
> TIA,
>
> Rich
>
> ______________________________________________
> R-help using 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.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list