Re: [R] abind, but on lists?

2009-09-03 Thread Richard M. Heiberger
Peter, Thank you for the dput values. Kenn points out that result <- cbind(data1[,,1], data2[,,1]) dim(result) <- c(3,3,1) gets what you want. We wrote abind to bind atomic arrays and/or data.frames. The list feature, which is interfering with your usage, was designed to simplify calling se

Re: [R] abind, but on lists?

2009-09-03 Thread Kenn Konstabel
On Thu, Sep 3, 2009 at 5:50 AM, Peter Meilstrup wrote: > I'm trying to massage some data from Matlab into R. The matlab file has a > "struct array" which when imported into R using the R.matlab package, > becomes an R list with 3+ dimensions, the first of which corresponds to the > structure fiel

Re: [R] abind, but on lists?

2009-09-02 Thread Peter Meilstrup
On Sep 2, 2009, at 8:47 PM, Richard M. Heiberger wrote: Almost certainly, abind is what you need for the task. Please dput() your matlab objects and send that to the list. That will make your example reproducible. Rich From the documentation and behavior, abind seems to really not want to

Re: [R] abind, but on lists?

2009-09-02 Thread Richard M. Heiberger
Almost certainly, abind is what you need for the task. Please dput() your matlab objects and send that to the list. That will make your example reproducible. Rich __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] abind, but on lists?

2009-09-02 Thread David Winsemius
On Sep 2, 2009, at 10:50 PM, Peter Meilstrup wrote: I'm trying to massage some data from Matlab into R. The matlab file has a "struct array" which when imported into R using the R.matlab package, becomes an R list with 3+ dimensions, the first of which corresponds to the structure fields,

[R] abind, but on lists?

2009-09-02 Thread Peter Meilstrup
I'm trying to massage some data from Matlab into R. The matlab file has a "struct array" which when imported into R using the R.matlab package, becomes an R list with 3+ dimensions, the first of which corresponds to the structure fields, with corresponding row names, and the second and thi

Re: [R] abind

2008-10-28 Thread Tony Plate
It looks like you are trying to construct a ragged array, where the extent of the dimensions varies. However, in R, ordinary arrays have a regular structure, e.g., the rows of a matrix always have the same number of columns. This is the kind of object abind() constructs. So, to bind your two

Re: [R] abind

2008-10-28 Thread Henrique Dallazuanna
You can use lists for this: list(a, b) On Tue, Oct 28, 2008 at 3:39 PM, Suyan Tian <[EMAIL PROTECTED]>wrote: > I am trying to combine two arrays with different dimensions into one. For > example > > The first one is > 1 2 3 > 4 5 6 > > The second one is > 7 8 > 9 10 > > The resulted one woul

[R] abind

2008-10-28 Thread Suyan Tian
I am trying to combine two arrays with different dimensions into one. For example The first one is 1 2 3 4 5 6 The second one is 7 8 9 10 The resulted one would be like , , 1 1 2 3 4 5 6 , , 2 7 8 9 10 I used abind to do this, but failed. Could somebody please let me know how to do thi