Re: [R] Array Help

2011-03-07 Thread Richard M. Heiberger
abind works well for this example. a1 <- array(1:18, dim=c(3,3,2)) a2 <- array(101:150, dim=c(5,5,2)) a1b <- abind(a1, array(400, dim=c(2,3,2)), along=1) a1c <- abind(a1b, array(500, dim=c(5,2,2)), along=2) dim(a1c) a1 a2 a1c On Mon, Mar 7, 2011 at 6:54 AM, Usman Munir wrote: > Hi, > > I ha

[R] Array Help

2011-03-07 Thread Usman Munir
Hi, I have two 3 D arrays. Both are of this form array_1<- array[n,n,k] array_2<-array[m,m,k] Lets say n=83 and m=80 Since n>m. I would like to add rows and columns to array_2 to make them equal. I want to keep the size of the third dimension fixed i.e.. k. i.e. if (nrow(array_1)>nrow(array_2))

Re: [R] Array help

2010-11-29 Thread bfhancock
Thank you Joshua!! StatTemps[c(1:7, 22:34), ] that's what i needed! I needed different ranges of rows but it is exactly what i was looking for. Thanks so much!! R can be kind of fun! hehe -- View this message in context: http://r.789695.n4.nabble.com/Array-help-tp3062992p3064907.html Sent fr

Re: [R] Array help

2010-11-29 Thread Joshua Wiley
Hi Brian, I believe there was some miscommunication earlier due to R's array class for objects and the colloquial usage of array (the idea that 'array' is used colloquially is a bit odd, but I digress). In any case, here are some steps I take (certainly not the only ones) when exploring a new dat

Re: [R] Array help

2010-11-29 Thread bfhancock
if you can load the PASWR package and pull up StatTemps you will see what I am talking about. Otherwise I fear that my question will just be confusing. -- View this message in context: http://r.789695.n4.nabble.com/Array-help-tp3062992p3063535.html Sent from the R help mailing list archive at

Re: [R] Array help

2010-11-29 Thread Patrick Burns
Instead of: 7:11&23:34 I think you mean: c(7:11, 23:34) Using '&' for concatenation is not an unreasonable idea, but it is decidedly not what R does. It would be instructive to do: 7:11 & 23:34 at the R prompt to see what you get. On 29/11/2010 03:56, bfhancock wrote: Josh, the d

Re: [R] Array help

2010-11-28 Thread David Winsemius
On Nov 28, 2010, at 10:56 PM, bfhancock wrote: Josh, the data set is called StatTemps and is in the PASWR package. I want to make an array that involves only the 8 a.m. and a separate array that involves only the 9 a.m. so i can get info on the temperatures in those groups. So I still w

Re: [R] Array help

2010-11-28 Thread bfhancock
Josh, the data set is called StatTemps and is in the PASWR package. I want to make an array that involves only the 8 a.m. and a separate array that involves only the 9 a.m. so i can get info on the temperatures in those groups. So I still want it in the format of StatTemps but in two arrays that

Re: [R] Array help

2010-11-28 Thread Joshua Wiley
Hi B, What you need to do is pass a vector with the indices you want to extract. So, you have 1:7 (which expands to 1, 2, 3, ... 7) and 12:34 (which again expands). How would you combine two sets of numbers? c(), the combine or concatenate function. Putting this in action: mya <- array(1:510,

[R] Array help

2010-11-28 Thread bfhancock
Hi! I am learning R and have a question that is probably fairly simple for those of you much more learned than I. I am messing with Arrays and am doing some simple stuff to get the hang of them. I will have a seperate array already pulled up and it will have columns and rows. I figured out th