[R] If it's not a data.frame, matrix or vector, what is it?

michael watson (IAH-C) michael.watson at bbsrc.ac.uk
Fri Dec 17 17:13:13 CET 2004


OK I'm definitely being a bit ignorant (so please accept my apologies)
of R and it's internal data storage.

When I created the data.frame, I did use I() with this column - the
original data being a vector created simply with "vector()".  It's clear
now that I didn't realise exactly what this was doing (all I wanted was
for it to NOT be converted to a factor).  

> str(submin[,display.gname])
Class 'AsIs'  chr [1:4622] "" "" "" "" ...
> is.array(submin[,display.gname])
[1] FALSE
> class(submin[,display.gname])
[1] "AsIs"

But I am still confused; I program mainly in perl and java, and this
"thing" - it's not a vector, an array, a matrix or a data.frame - so
what is "it"? :-S

Thanks 

Mick


-----Original Message-----
From: Liaw, Andy [mailto:andy_liaw at merck.com] 
Sent: 17 December 2004 15:55
To: michael watson (IAH-C); r-help at stat.math.ethz.ch
Subject: RE: [R] If it's not a data.frame, matrix or vector, what is it?


What does str(submin$display.gname) say?

Andy

> From: michael watson (IAH-C)
> 
> Hi
> 
> Forgive my ignorance.  I am selecting a column of a
> data.frame using the
> column name, and I want to know what the resulting column 
> "is".  My data
> frame is called "submin" and the column name is held in a variable
> called "display.gname" Eg:
> 
> > is.data.frame(submin)
> [1] TRUE
> > is.data.frame(submin[,display.gname])
> [1] FALSE
> > is.matrix(submin[,display.gname])
> [1] FALSE
> > is.vector(submin[,display.gname])
> [1] FALSE
> > length(submin[,display.gname])
> [1] 4622
> 
> So if it's not a data.frame, a matrix or a vector, what is "it"?
> 
> Thanks (and sorry if this is in the FAQ)
> 
> Mick
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list 
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
> 
> 


------------------------------------------------------------------------
------
Notice:  This e-mail message, together with any attachments,...{{dropped}}




More information about the R-help mailing list