[R] modifying only certain rows in a data-frame
jholtman at gmail.com
Sun May 30 02:15:50 CEST 2010
try something like:
r$deltact[r$time == '0h'] <- 0
On Sat, May 29, 2010 at 7:50 PM, ANJAN PURKAYASTHA
<anjan.purkayastha at gmail.com> wrote:
> I have a data-frame r (shown below is a subset) with the following column
> date time sample vct norm hct deltact
> $time has 8 levels: 0h, 0.5h, .....24h. $deltact holds real numbers.
> I want to subset this dataframe by the levels of $time. For all the rows
> which have r$time == "0h" I would like to convert the present value of
> r$deltact to 0.
> Any pointers to a simple method to accomplish would be greatly appreciated.
> anjan purkayastha, phd.
> research associate
> fas center for systems biology,
> harvard university
> 52 oxford street
> cambridge ma
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
+1 513 646 9390
What is the problem that you are trying to solve?
More information about the R-help