Just use the ==
with the negation symbol (!
). If dtfm is the name of your data.frame:
dtfm[!dtfm$C == "Foo", ]
Or, to move the negation in the comparison:
dtfm[dtfm$C != "Foo", ]
Or, even shorter using subset()
:
subset(dtfm, C!="Foo")
More Related Contents:
- Filter data.frame rows by a logical condition
- Split column at delimiter in data frame [duplicate]
- Pass a data.frame column name to a function
- How to convert a list consisting of vector of different lengths to a usable data frame in R?
- Select groups based on number of unique / distinct values
- Assign multiple columns using := in data.table, by group
- Filtering a data frame on a vector [duplicate]
- How to replace NA values in a table for selected columns
- Remove an entire column from a data.frame in R
- Selecting multiple odd or even columns/rows for dataframe
- Sample n random rows per group in a dataframe
- Deleting reversed duplicates with R
- Select every nth row from dataframe
- Growing a data.frame in a memory-efficient manner
- R list of lists to data.frame
- Remove columns from dataframe where some of values are NA
- Check whether values in one data frame column exist in a second data frame
- How do you remove columns from a data.frame?
- Deleting columns from a data.frame where NA is more than 15% of the column length [duplicate]
- Using lapply to apply a function over list of data frames and saving output to files with different names
- DT[!(x == .)] and DT[x != .] treat NA in x inconsistently
- Return df with a columns values that occur more than once [duplicate]
- Row-wise sum of values grouped by columns with same name
- Replicate each row of data.frame and specify the number of replications for each row?
- Count unique values for every column
- Numbers as column names of data frames
- Divide each value by the sum of values by group
- Convert all data frame character columns to factors
- What you can do with a data.frame that you can’t with a data.table?
- Override column types when importing data using readr::read_csv() when there are many columns