Re: [R] About 5.1 Arrays

2010-11-08 Thread Stephen Liu
ce and effort. B.R. Stephen L - Original Message From: Joshua Wiley To: Stephen Liu Cc: r-help@r-project.org Sent: Mon, November 8, 2010 8:33:50 AM Subject: Re: [R] About 5.1 Arrays On Sat, Nov 6, 2010 at 7:38 AM, Stephen Liu wrote: > Hi Joshua, > > Thanks for your advice

Re: [R] About 5.1 Arrays

2010-11-07 Thread Joshua Wiley
On Sat, Nov 6, 2010 at 7:38 AM, Stephen Liu wrote: > Hi Joshua, > > Thanks for your advice. > > 1) > Re your advice:-[quote] >> a3d > , , 1 <--- this is the first position of the third dimension ***THIS IS THE > THIRD DIMENSION*** > >     [,1] [,2] [,3] [,4]  <--- positions 1, 2, 3, 4 of the seco

Re: [R] About 5.1 Arrays

2010-11-07 Thread Michael Friendly
Hi Stephan Since early in November you have posted queries on R-help on 5 different topics as you are trying to learn to use R. This is a good thing, and many contributors to R-help have replied, taking pains to provide explanations and examples to be helpful. But, in return, it doesn't appear

Re: [R] About 5.1 Arrays

2010-11-06 Thread Stephen Liu
dlund To: r-help@r-project.org Sent: Sun, November 7, 2010 2:08:04 AM Subject: Re: [R] About 5.1 Arrays > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Stephen Liu > Sent: Saturday, November 06, 2010 7:38 AM &g

Re: [R] About 5.1 Arrays

2010-11-06 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Stephen Liu > Sent: Saturday, November 06, 2010 7:38 AM > To: Joshua Wiley > Cc: r-help@r-project.org > Subject: Re: [R] About 5.1 Arrays > > Hi J

Re: [R] About 5.1 Arrays

2010-11-06 Thread Stephen Liu
258 11 [3,]369 12 , , 2 [,1] [,2] [,3] [,4] [1,] 13 16 19 22 [2,] 14 17 20 23 [3,] 15 18 21 24 Correct. If I'm wrong, pls correct me. Thanks B.R. Stephen - Original Message From: Joshua Wiley To: Stephen Liu Cc: r-hel

Re: [R] About 5.1 Arrays

2010-11-06 Thread Stephen Liu
Sent: Sat, November 6, 2010 12:48:35 AM Subject: Re: [R] About 5.1 Arrays Continuing with Daniel's example, but with different data values a <- sample(24) a dim(a) <- c(3,4,2) a as.vector(a) ## for an array with ## dim(a) == c(3,4,2) ## a[i,j,k] means select the element in posi

Re: [R] About 5.1 Arrays

2010-11-05 Thread RICHARD M. HEIBERGER
Continuing with Daniel's example, but with different data values a <- sample(24) a dim(a) <- c(3,4,2) a as.vector(a) ## for an array with ## dim(a) == c(3,4,2) ## a[i,j,k] means select the element in position ##i + (j-1)*3 + (k-1)*3*4 index <- function(i,j,k) { i + (j-1)*3 + (k-1)*3*4 }

Re: [R] About 5.1 Arrays

2010-11-05 Thread Joshua Wiley
- Original Message > From: Daniel Nordlund > To: r-help@r-project.org > Sent: Fri, November 5, 2010 11:54:15 PM > Subject: Re: [R] About 5.1 Arrays > >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] >

Re: [R] About 5.1 Arrays

2010-11-05 Thread Stephen Liu
riginal Message From: Daniel Nordlund To: r-help@r-project.org Sent: Fri, November 5, 2010 11:54:15 PM Subject: Re: [R] About 5.1 Arrays > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Stephen Liu > Sent: Friday, Nov

Re: [R] About 5.1 Arrays

2010-11-05 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Stephen Liu > Sent: Friday, November 05, 2010 7:57 AM > To: Steve Lianoglou > Cc: r-help@r-project.org > Subject: Re: [R] About 5.1 Arrays > > Hi S

Re: [R] About 5.1 Arrays

2010-11-05 Thread Steve Lianoglou
Hi, On Fri, Nov 5, 2010 at 10:56 AM, Stephen Liu wrote: > Hi Steve, > >> It's not clear what you're having problems understanding. By >> setting the "dim" attribute of your (1d) vector, you are changing >> itsdimenensions. > > I'm following An Introduction to R to learn R > > On > > 5.1 Arrays >

Re: [R] About 5.1 Arrays

2010-11-05 Thread Stephen Liu
nal Message From: Steve Lianoglou To: Stephen Liu Cc: Gerrit Eichner ; r-help@r-project.org Sent: Fri, November 5, 2010 10:18:18 PM Subject: Re: [R] About 5.1 Arrays Hi, On Fri, Nov 5, 2010 at 6:00 AM, Stephen Liu wrote: [snip] >> A[i, j, k] is the value of the element in position (i,j,k)

Re: [R] About 5.1 Arrays

2010-11-05 Thread Steve Lianoglou
Hi, On Fri, Nov 5, 2010 at 6:00 AM, Stephen Liu wrote: [snip] >> A[i, j, k] is the value of the element in position (i,j,k) of array A. In >> other words, it is the entry in row i, column j, and "layer" k (if one >> wants to think of A as a cuboidal grid). > > Sorry I can't follow.  Could you pls

Re: [R] About 5.1 Arrays

2010-11-05 Thread Stephen Liu
Hi Gerrit, Thanks for your advice. - snip - > A[i, j, k] is the value of the element in position (i,j,k) of array A. In > other words, it is the entry in row i, column j, and "layer" k (if one > wants to think of A as a cuboidal grid). Sorry I can't follow. Could you pls explain in more d

Re: [R] About 5.1 Arrays

2010-11-05 Thread Gerrit Eichner
On Fri, 5 Nov 2010, Stephen Liu wrote: [snip] "0" is counted as 1 object. Of course! It is a number like any other. Does "object length" mean the total number of objects/entries? Yes. Please help me to understand follow; "For example if the dimension vector for an array, say a, is c(3,4

[R] About 5.1 Arrays

2010-11-05 Thread Stephen Liu
Hi folks, (Learning R) 5.1 Arrays http://cran.r-project.org/doc/manuals/R-intro.html#Vectors-and-assignment 1) If continued on previous example (3.1 Intrinsic attributes: mode and length), > z <- 0:9 > dim(z) <- c(3,5,100) Error in dim(z) <- c(3, 5, 100) : dims [product 1500] do not match th