Skip to content
Prev 239531 / 398500 Next

Data.frame Vs Matrix Vs Array: Definitions Please

On Wed, Oct 27, 2010 at 8:38 AM, Ivan Calandra
<ivan.calandra at uni-hamburg.de> wrote:
Maybe you used APL before.   The basic structure in that language is
an array but that is not the case for R. The basic structure for data
is a vector and more complex data objects are build from that.  An
array is a more complex object than a vector.  A 1d array is not the
same as a vector.  Dimensions are an additional concept unlike APL.
A list is really a vector of pointers so the components are of the
same type.  Its just that you can't access the pointer nature of the
components.  For example, you can have a matrix based on a list.  We
have added a dimension to the list so it becomes an array even though
its based on a list:
structure(list(.Primitive("sin"), "a", 1, list(1:3)), .Dim = c(2L,
2L))
[,1] [,2]
[1,] ?    1
[2,] "a"  List,1
[1] TRUE
[1] "matrix"
names don't count. Neither does class.