Skip to content

Question about Structure

2 messages · Partha Bagchi, Peter Dalgaard

#
Hello,
Perhaps I am missing something here about the function structure() (Platfrm etc.
in the end?
[,1] [,2] [,3]
[1,]    1    3    5
[2,]    2    4    6
[,1] [,2]
[1,]    1    4
[2,]    2    5
[3,]    3    6
[,1] [,2]
[1,]    1    2
[,1]
[1,]    1
[2,]    2
Error: dim<- length of dims do not match the length of object
Error: dim<- length of dims do not match the length of object
Error: dim<- length of dims do not match the length of object
Error: dim<- length of dims do not match the length of object
_
platform   Windows
arch       x86
os         Win32
system     x86, Win32
status     Beta
status.rev 0
major      0
minor      63.3
year       1999
month      March
day        6
language   R
TIA for any explanations
Partha.



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
"Partha Bagchi" <Partha_Bagchi at hgsi.com> writes:
Nope. You're missing something about the ":" operator
1:3 == c(1,2,3)
3:1 == c(3,2,1)

dim=3:1 means you want this as a 3x2x1 array, 6 cells in total, but 3 data.
1x2x3-array...
2:2 = from 2 to 2 step 1 = 2

2-array, four values
1x2x3x4 array, 24 cells, four values.