Re: [R] r data structures

2012-08-17 Thread Patrick Burns
To slightly correct what's been said: In general lists are linear objects, but a list can have dimension. An example is in Circle 8.1.8 of 'The R Inferno'. http://www.burns-stat.com/pages/Tutor/R_inferno.pdf Pat On 16/08/2012 21:50, Schumacher, Jay S wrote: are these

[R] r data structures

2012-08-16 Thread Schumacher, Jay S
hi, i'm trying to understand r data structures. i see that vectors, matrix, factors and arrays have a dimension. there seems to be no mention of dimensionality anywhere for lists or dataframes. can i consider lists and frames to be of fixed dimension 2? thanks, jay s

Re: [R] r data structures

2012-08-16 Thread Steve Lianoglou
Hi, On Thu, Aug 16, 2012 at 2:49 PM, Schumacher, Jay S j...@neo.tamu.edu wrote: hi, i'm trying to understand r data structures. i see that vectors, matrix, factors and arrays have a dimension. Out of curiosity, where do you see that vectors and factors have a dimension? I mean -- I

Re: [R] r data structures

2012-08-16 Thread David Winsemius
On Aug 16, 2012, at 11:49 AM, Schumacher, Jay S wrote: hi, i'm trying to understand r data structures. i see that vectors, matrix, factors and arrays have a dimension. there seems to be no mention of dimensionality anywhere for lists or dataframes. can i consider lists and frames to

Re: [R] r data structures

2012-08-16 Thread MacQueen, Don
It would be helpful to distinguish between a formal dimension attribute, and a (personal) conceptual model of whether or not any particular R object, or type of object, has dimension. Mention of data frames having dimension can be found in the help page for the dim() function. foo - 1:10

Re: [R] r data structures

2012-08-16 Thread Schumacher, Jay S
are these correct/accurate/sensible statements: a vector is a one dimensional object. a matrix is a two dimensional object. a list is a one dimensional object. i'm working from this web page: http://www.agr.kuleuven.ac.be/vakken/statisticsbyR/someDataStructures.htm

Re: [R] r data structures

2012-08-16 Thread R. Michael Weylandt
On Thu, Aug 16, 2012 at 4:50 PM, Schumacher, Jay S j...@neo.tamu.edu wrote: are these correct/accurate/sensible statements: a vector is a one dimensional object. a matrix is a two dimensional object. a list is a one dimensional object. i'm working from this web page:

Re: [R] r data structures

2012-08-16 Thread Schumacher, Jay S
yes, thank you, conceptual model (rather than formal dimension attribute) is where i'm coming from at this point. It would be helpful to distinguish between a formal dimension attribute, and a (personal) conceptual model of whether or not any

Re: [R] r data structures

2012-08-16 Thread David Winsemius
On Aug 16, 2012, at 1:50 PM, Schumacher, Jay S wrote: are these correct/accurate/sensible statements: a vector is a one dimensional object. a matrix is a two dimensional object. a list is a one dimensional object. i'm working from this web page:

Re: [R] r data structures

2012-08-16 Thread MacQueen, Don
I don't disagree with Michael, but I would add that to me it also depends. If one thinks in terms of subsetting an object (for objects that can be subsetted) To subset a vector, one supplies *one* value for the index: myvector[3] myvector[ 2:5 ] are valid statements. Similarly for a list

Re: [R] r data structures

2012-08-16 Thread R. Michael Weylandt
On Thu, Aug 16, 2012 at 5:44 PM, MacQueen, Don macque...@llnl.gov wrote: Whereas for a matrix or data frame, one must supply *two* index values (even if one of them may be omitted) mydf[ 1 , 3 ] mydf[ , 5 ] mymat[ 2:5 , ] mymat[ 3 , 4:6 ] are valid statements. Not quite: