Re: [R] peculiar matrices

2005-10-23 Thread Ben Bolker
thanks all; this makes sense now. For what it's worth, this came up in the context of mapply(...,SIMPLIFY=TRUE), which returned a matrix as requested, but an odd-looking one. cheers Ben Bolker __ R-help@stat.math.ethz.ch mailing list

Re: [R] peculiar matrices

2005-10-22 Thread Prof Brian Ripley
Just to add to what others have said, don't confuse how an object is printed with its structure. This must be intentional as the internal code has a specific section just to print list arrays/matrices. ?matrix has the first argument as data: an optional data vector. and a list is a

[R] peculiar matrices

2005-10-21 Thread Ben Bolker
As far as I can tell from reading The Fine Documentation (R Language Definition and Intro to R), matrices are supposed to be of homogeneous types. Yet giving matrix() an inhomogeneous list seems to work, although it produces a peculiar object: v = list(1:3,4,5,a) m = matrix(v,nrow=2) m

Re: [R] peculiar matrices

2005-10-21 Thread Marc Schwartz (via MN)
On Fri, 2005-10-21 at 21:32 +, Ben Bolker wrote: As far as I can tell from reading The Fine Documentation (R Language Definition and Intro to R), matrices are supposed to be of homogeneous types. Yet giving matrix() an inhomogeneous list seems to work, although it produces a peculiar

Re: [R] peculiar matrices

2005-10-21 Thread Berton Gunter
learning process. - George E. P. Box -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ben Bolker Sent: Friday, October 21, 2005 2:33 PM To: r-help@stat.math.ethz.ch Subject: [R] peculiar matrices As far as I can tell from reading The Fine

Re: [R] peculiar matrices

2005-10-21 Thread Gabor Grothendieck
The reference manual of 2.2.0 says in section 2.2 that Matrices and arrays are simply vectors with the attribute dim and optionally dimnames. Now earlier in section 2.1 it discusses vectors and I think that that is where the confusing part lies. Section 2.1 starts out saying that Vectors can be