Skip to content
Prev 274441 / 398506 Next

Length of data.frame column

On Oct 14, 2011, at 5:11 AM, Petr PIKAL wrote:

            
Or at least a list. The "c" function stripped its attributes:

 > str( c( data.frame(a=1:10) ) )
List of 1
  $ a: int [1:10] 1 2 3 4 5 6 7 8 9 10

Which also is an explanation for why its length is still reported as 1.
One might think that as.vector might be able to extract a vector from  
a list if length 1 but one would be wrong and should then got to :

?unlist
David Winsemius, MD
West Hartford, CT