Re: [R] working on a data frame

2014-07-28 Thread Matthew
bounces@r- project.org] On Behalf Of William Dunlap Sent: Friday, July 25, 2014 8:07 PM To: Matthew Cc: r-help@r-project.org Subject: Re: [R] working on a data frame if yourData[,8]==0, then yourData[,8]==1, yourData[,10] <- yourData[,9]/yourData[,8] You could do express this in R as

Re: [R] working on a data frame

2014-07-27 Thread PIKAL Petr
Cc: r-help@r-project.org > Subject: Re: [R] working on a data frame > > > if > > yourData[,8]==0, > > then > > yourData[,8]==1, yourData[,10] <- yourData[,9]/yourData[,8] > > You could do express this in R as >is8Zero <- yourData[,8] == 0 >yo

Re: [R] working on a data frame

2014-07-25 Thread William Dunlap
] >> yourData[yourData[,8]==0,10] <- yourData[yourData[,8]==0,9] >> >> This doesn't change the 0 to 1 in column 8, but it doesn't appear you >> actually need to do that. >> >> HTH >> >> Peter Alspach >> >> -----Original Me

Re: [R] working on a data frame

2014-07-25 Thread Matthew
r-help@r-project.org Subject: Re: [R] working on a data frame On 7/24/2014 8:52 PM, Sarah Goslee wrote: Hi, Your description isn't clear: On Thursday, July 24, 2014, Matthew mailto:mccorm...@molbio.mgh.harvard.edu>> wrote: I am coming from the perspective of Excel and VBA

Re: [R] working on a data frame

2014-07-24 Thread Peter Alspach
--- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Matthew McCormack Sent: Friday, 25 July 2014 3:16 p.m. To: Sarah Goslee Cc: r-help@r-project.org Subject: Re: [R] working on a data frame On 7/24/2014 8:52 PM, Sarah Goslee wrote: > Hi, > > Your descr

Re: [R] working on a data frame

2014-07-24 Thread Matthew McCormack
On 7/24/2014 8:52 PM, Sarah Goslee wrote: > Hi, > > Your description isn't clear: > > On Thursday, July 24, 2014, Matthew > wrote: > > I am coming from the perspective of Excel and VBA scripts, but I > would like to do the following in R. > >

Re: [R] working on a data frame

2014-07-24 Thread Sarah Goslee
Hi, Your description isn't clear: On Thursday, July 24, 2014, Matthew wrote: > I am coming from the perspective of Excel and VBA scripts, but I would > like to do the following in R. > > I have a data frame with 14 columns and 32,795 rows. > > I want to check the value in column 8 (row 1) to s

[R] working on a data frame

2014-07-24 Thread Matthew
I am coming from the perspective of Excel and VBA scripts, but I would like to do the following in R. I have a data frame with 14 columns and 32,795 rows. I want to check the value in column 8 (row 1) to see if it is a 0. If it is not a zero, proceed to the next row and check the value for co