[Rd] boundary case anomaly

Robert Gentleman rgentlem at fhcrc.org
Sun Apr 8 10:09:05 CEST 2007


Hi,
  Any reason these should be different?

  x=matrix(0, nr=0, nc=3)
  colnames(x) = letters[1:3]
  data.frame(x)
#[1] a b c
#<0 rows> (or 0-length row.names)
  y=vector("list", length=3)
  names(y) = letters[1:3]
  data.frame(y)
#NULL data frame with 0 rows


both should have names (the second one does not) and why print something 
different for y?

  The two of the last three examples refer to a "NULL data frame", eg
   (d00 <- d0[FALSE,])  # NULL data frame with 0 rows

  but there is no description of what a NULL data frame should be (zero 
rows or zero columns, or either or both - and why a special name?)


  best wishes
    Robert


-- 
Robert Gentleman, PhD
Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M2-B876
PO Box 19024
Seattle, Washington 98109-1024
206-667-7700
rgentlem at fhcrc.org



More information about the R-devel mailing list