[R] question regarding conversion from factor to vector

Oliver Kullmann O.Kullmann at swansea.ac.uk
Sat Mar 27 19:07:58 CET 2010


thank you! (I was on the wrong track, and thinking these would
be "levels".)

Oliver

> In this case where the is only one dimension, the table object is more  
> like a named vector. The first "vector" in your terminology (but would  
> be more accurately called "labels") can be accessed with:
> 
>  names( table(E$singles) )
> 
> If you want the counts without the lables , then just use the unname  
> function:
> 
> unname( table(E$singles) )
> -- 
> David.



More information about the R-help mailing list