Re: [R] Help with understanding [[]] [] array, list, matrix referencing

2006-10-25 Thread Joe Byers
I want to thank everyone for their comments and suggestions. P. Burns' S Poetry I think will be a lot of help and I thought it was really poetry:). So will the other references that were provided by I believe Mr Kane. The other replies provided me some great insights. If I understand R uses

Re: [R] Help with understanding [[]] [] array, list, matrix referencing

2006-10-24 Thread David Barron
Have you tried help([), which gives a good explanation. On 24/10/06, Joe W. Byers [EMAIL PROTECTED] wrote: Hi all, I would greatly appreciate some help understanding how R references arrays, matrices, lists, and objects using [[]] and []. I have read the R guides and several tutorials but

Re: [R] Help with understanding [[]] [] array, list, matrix referencing

2006-10-24 Thread Joe Byers
David, Yes, I did. I just still do not get it. That is why I ask here. Hoping someone knew a step by step guide that I could look at. My trial and error approach takes me hours some days. I currently move most things in and out of data.frames where I can name the columns and reference

Re: [R] Help with understanding [[]] [] array, list, matrix referencing

2006-10-24 Thread David Barron
Well, as I understand it, with a list [] doesn't return the actual contents of that element of the list, whereas [[]] does. Compare, for example rnds[1] + 1 with rnds[[1]] + 1. So, with a list you have to use the double bracket notation to get to the actual contents of that element of the list,

Re: [R] Help with understanding [[]] [] array, list, matrix referencing

2006-10-24 Thread Joe Byers
Thank you so very much. I can try this on my own examples. Much appreciated. Joe David Barron wrote: Well, as I understand it, with a list [] doesn't return the actual contents of that element of the list, whereas [[]] does. Compare, for example rnds[1] + 1 with rnds[[1]] + 1. So, with a

Re: [R] Help with understanding [[]] [] array, list, matrix referencing

2006-10-24 Thread John Kane
--- Joe Byers [EMAIL PROTECTED] wrote: David, Yes, I did. I just still do not get it. That is why I ask here. Hoping someone knew a step by step guide that I could look at. My trial and error approach takes me hours some days. I currently move most things in and out of

Re: [R] Help with understanding [[]] [] array, list, matrix referencing

2006-10-24 Thread Thomas Lumley
On Tue, 24 Oct 2006, Joe W. Byers wrote: following code produces a 5 element list of 2X5 random numbers that I then convert to a 2X5X5 matrix. cov-matrix(c(.4,-.1,-.1,.3),nrow=2,ncol=2) rnds-NULL; for (i in 1:5){ t1-rnorm(5,cov) t2-rnorm(5,cov) t3-rbind(t1,t2)