[R] Error creating named character vectors from column names in data frame.
Jorge Cimentada
cimentadaj at gmail.com
Fri Oct 7 18:06:21 CEST 2016
Hi everyone,
I was hoping someone would explain why this doesn't work.
c("a" = "b") # named character vector
class("a") # character
class("b") # character
c(names(mtcars)[1] = names(mtcars[2]) # error
class(names(mtcars)[1]) # character
class(names(mtcars)[2]) # character
Thanks,
Jorge Cimentada
[[alternative HTML version deleted]]
More information about the R-help
mailing list