Re: [R] Having some Trouble Data Structures

2012-11-04 Thread Jeff Newmiller
__ >From: Jeff Newmiller [jdnew...@dcn.davis.ca.us] >Sent: 28 October 2012 15:27 >To: Benjamin Ward (ENV); r-help@r-project.org >Subject: Re: [R] Having some Trouble Data Structures > >Search on "ragged array". > >My preferred approac

Re: [R] Having some Trouble Data Structures

2012-10-28 Thread arun
9496 9167 #[3,] 4229 3282 6235 #[4,] 5388 3088 6420 #[5,] 5602 5981 4749 #[6,] 4971 6956 5913 A.K. - Original Message - From: Benjamin Ward (ENV) To: "r-help@r-project.org" Cc: Sent: Sunday, October 28, 2012 5:32 AM Subject: [R] Having some Trouble Data Structures Hi Al

Re: [R] Having some Trouble Data Structures

2012-10-28 Thread arun
de in my previous reply which was not required and it will not work.  #list1<-lapply(1:nrow(dat1),function(x) paste(sample(1:1,3,replace=TRUE)),sep=",") A.K. - Original Message - From: Benjamin Ward (ENV) To: "r-help@r-project.org" Cc: Sent: Sunday, Octo

Re: [R] Having some Trouble Data Structures

2012-10-28 Thread Jeff Newmiller
Search on "ragged array". My preferred approach is to use a data frame with one row per effector that repeats the per-ID information. If that occupies too much memory, you can setup another data frame with one row per ID and refer to that information as using lapply and subset the effectors da

Re: [R] Having some Trouble Data Structures

2012-10-28 Thread Uwe Ligges
On 28.10.2012 10:32, Benjamin Ward (ENV) wrote: Hi All, I'm trying to run a simulation of host-pathogen evolution based around individuals. What I need to have is a dataframe or table of some description - describing all the individuals of a pathogen population (so far I've implemented this

[R] Having some Trouble Data Structures

2012-10-28 Thread Benjamin Ward (ENV)
Hi All, I'm trying to run a simulation of host-pathogen evolution based around individuals. What I need to have is a dataframe or table of some description - describing all the individuals of a pathogen population (so far I've implemented this as a matrix): ID No_of_Effectors