Skip to content
Prev 273108 / 398506 Next

subset in dataframes

Hi,
On Sun, Oct 2, 2011 at 7:48 AM, Cecilia Carmo <cecilia.carmo at ua.pt> wrote:
Thank you for providing a reproducible example.
What about finding which ones have negative values and should be deleted,
[1] 1 2

And then deleting them?
year firm   x    y
9  2001    3 101 1010
10 2002    3  14  140
11 2003    3  87  870
12 2004    3  56  560
13 2001    4  12  120
14 2002    4  43  430
15 2003    4  67  670
16 2004    4  54  540
If you look at just the result of part of your code,
subset(data1,data1$x>0)
it isn't giving at all what you need for the next step: the entire
data frame for x>0.


Sarah