Re: [R] subsetting dataframe multiple conditions

2013-05-09 Thread Rui Barradas
Hello, Em 09-05-2013 20:44, Sarah Goslee escreveu: Hi, On Thu, May 9, 2013 at 12:28 PM, KatrinH Heimann wrote: Dear all, I would like to subset a dataframe using multiple conditions. So if I have two columns 1 and 2, I would like to EXCLUDE all rows in which the value of column 1 is "a" AND t

Re: [R] subsetting dataframe multiple conditions

2013-05-09 Thread Rui Barradas
Hello, It's difficult to know what's going on without a data example. Can you post the output of dput(head(data, 30)) ? Maybe the columns are not of class "character" but of class "factor". You should also post the output of str(data) In the mean time, try subset(data, column1 != "a" &

Re: [R] subsetting dataframe multiple conditions

2013-05-09 Thread Sarah Goslee
Hi, On Thu, May 9, 2013 at 12:28 PM, KatrinH Heimann wrote: > Dear all, > I would like to subset a dataframe using multiple conditions. > So if I have two columns 1 and 2, I would like to EXCLUDE all rows in which > the value of column 1 is "a" AND the value of column 2 is "b". > I tried data[(da

[R] subsetting dataframe multiple conditions

2013-05-09 Thread KatrinH Heimann
Dear all, I would like to subset a dataframe using multiple conditions. So if I have two columns 1 and 2, I would like to EXCLUDE all rows in which the value of column 1 is "a" AND the value of column 2 is "b". I tried data[(data$column1 != "a" & data$column2 != "b"),] but that deletes me every row