Perfect, I had something very similar but didn't pass syntax - this
works fine. Will give an example next time.
-----Original Message-----
From: Sundar Dorai-Raj [mailto:sundar.dorai-raj@pdf.com]
Sent: 30 June 2005 16:13
To: Peter Leathers (peter@archfunds.com)
Cc: s-news@lists.biostat.wustl.edu
Subject: Re: [S] Exclude rows. from a dataframe
peter@archfunds.com wrote:
> Apologies if this is a dumb question, but have been searching and
> experimenting for a while without success. I have a dataframe with
dates
> and returns in it (2 columns) and want to create a new dataframe with
> only positive returns in it.
>
>
>
> Thanks in advance
>
>
>
> Peter
(An example would be nice.)
Would the following work for you?
# assume `x' is your data.frame
# with `return' your column of returns
pos.x <- x[x$return > 0, ]
HTH,
--sundar
|