[R] read.table(..., header == FALSE, colClasses = <vector with names attribute>)
jdnewmil at dcn.davis.ca.us
Tue Oct 24 02:51:59 CEST 2017
You are constructing the equivalent of a two-line data file, and complaining that it is not treating it like it was one line. If it did used to accept this silently [skeptical] then I for one am glad it produces a warning now.
Sent from my phone. Please excuse my brevity.
On October 23, 2017 2:53:21 PM PDT, Benjamin Tyner <btyner at gmail.com> wrote:
>I noticed that starting with R version 3.3.0 onward, this generates a
> > txt <- c("a", "3.14")
> > read.table(file = textConnection(txt), header = FALSE, colClasses
>= c(x = "character", y = "numeric"))
>the warning is "not all columns named in 'colClasses' exist" and I
>the change was made in response to this?
>Regardless, I am wondering whether this is desirable, that as a result
>of the change, the code has become stricter about the presence of a
>(formerly) harmless names attribute. Or am I missing something?
>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.
More information about the R-help