From mtmorgan at fhcrc.org  Tue May 13 18:15:56 2008
From: mtmorgan at fhcrc.org (Martin Morgan)
Date: Tue, 13 May 2008 09:15:56 -0700
Subject: [Rd] doc buglet / bug: row / col as.factor requires dimnames
Message-ID: <6phlk2e6uyr.fsf@gopher4.fhcrc.org>

col(matrix(0, 5, 5), as.factor=TRUE) fails

> col(matrix(0, 5, 5), as.factor=TRUE)
Error in factor(.Internal(col(dim(x))), labels = colnames(x)) : 
  invalid labels; length 0 should be 1 or 5

when the matrix has no dimnames. This is not as advertised. I would
have expected the equivalent of

factor(.Internal(col(dim(x))),
       labels=colnames(x, do.NULL=FALSE, prefix=""))

> sessionInfo()
R version 2.8.0 Under development (unstable) (2008-05-13 r45682) 
x86_64-unknown-linux-gnu 

Martin
-- 
Martin Morgan
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M2 B169
Phone: (206) 667-2793



[Rd] doc buglet / bug: row / col as.factor requires dimnames
Martin Morgan