[R] NA rownames in dataframes
Peter Dalgaard BSA
p.dalgaard at biostat.ku.dk
Wed Aug 28 22:09:47 CEST 2002
"Yi, Derek" <Derek.Yi at FMR.COM> writes:
> > data.frame(b)
> Error in if (missing(row.names) && (nrows[i] > 0) && (rowsi[[1]] != ""))
> row.names <- data.row.names(row.names, :
> missing value where logical needed
>
> > traceback()
> 3: data.frame(..., check.names = FALSE)
> 2: cbind(...)
> 1: cbind(b)
>
> This seems to be a problem associated only with dataframes, as a similar
> example using matrices works perfectly fine. Has anyone experienced this
> behavior before?
Not to my knowledge, on this list, anyway. However, it looks like a
fairly clear bug. I think you want
... && !(rowsi[[1]] %in% "")
in the relevant line about two-thirds through data.frame().
Character NA's (as opposed to the string "NA") are a relatively new
invention, and oversights like this are bound to happen.
(NA rownames are generally a bad idea, though...)
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list