Skip to content
Prev 309875 / 398506 Next

Having some Trouble Data Structures

From: Benjamin Ward (ENV)
Sent: 03 November 2012 13:29
To: Jeff Newmiller; r-help at r-project.org
Subject: RE: [R] Having some Trouble Data Structures

Hi,
Thank you very much for your reply - how you prefer, is how my supervisor implemented the layout in Minitab, however I was unsure of how to get R to do this repeating ID behaviour and how to know that in a for loop going through individual 1 to say 10, I want it to:

Randomly sample a number from a distribution for the number of effectors (I can do this but with runif),

Then put one value in a cell of the Effector column and repeat the ID for each effector row. I'm also then left wondering when I do for loops then that use ID, will it go and apply operations row by row, or ID by ID - for example in the immunology part I would need a loop to check individual by individual if any of the effectors it has means death in the host, in which case all instances of - say ID "1" would need to be deleted.

Would you be able to provide an example chunk of how you accomplish this with your preferred approach, if you have the time?

Thanks,
Ben W.
Message-ID: <142413609C0A60488585AB47438ECD9DBBCA07@ueastfexch02.UEA.AC.UK>
In-Reply-To: <142413609C0A60488585AB47438ECD9DBBBBB0@ueastfexch02.UEA.AC.UK>