[R] create structs in R.

From: Alaios <alaios_at_yahoo.com>
Date: Sat, 14 May 2011 04:28:29 -0700 (PDT)


Dear all,
so far when I want to create a struct with a substructs I create. Lists with sublists by using functions and replicate.

This will end up in to a struct that is addressed like that

for (i in c(1:100){
  for (j in c(1:100){

        Mystruct[[1]][[2]][[1]][[i]][[k]]<-dosomething()    }
}
It is not hard for one to understand that this form for addressing subfields of the struct [[1]][[2]][[1]]... and so on, make hard to track which field of the strut you are addressing to. Even worse when I open my code after one week I usually take some time to understand which field I wanted to address.

Is there something more easier that I can do to face both these types of problem?

I would like to thank you in advance for your help

Best Regards
Alex



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 14 May 2011 - 11:31:34 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 14 May 2011 - 14:50:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive