It works if you use duplicated
twice:
df[!(duplicated(df[c("c","d")]) | duplicated(df[c("c","d")], fromLast = TRUE)), ]
a b c d
1 1 2 A 1001
4 4 8 C 1003
7 7 13 E 1005
8 8 14 E 1006
More Related Contents:
- Delete rows that exist in another data frame? [duplicate]
- Select the row with the maximum value in each group
- Create a sequential number (counter) for rows within each group of a dataframe [duplicate]
- Extracting specific columns from a data frame
- Find indices of duplicated rows [duplicate]
- How to drop columns by name in a data frame
- Reshape multiple values at once
- Remove columns from dataframe where ALL values are NA
- How to move cells with a value row-wise to the left in a dataframe [duplicate]
- Match values in data frame with values in another data frame and replace former with a corresponding pattern from the other data frame
- Detect at least one match between each data frame row and values in vector
- Converting nested list to dataframe
- Converting a data frame to xts
- Interpolate NA values in a data frame with na.approx
- How to subset data in R without losing NA rows?
- How to delete columns that contain ONLY NAs?
- Using grep to help subset a data frame
- Merge rows in a dataframe where the rows are disjoint and contain NAs
- How to sort a data frame by date
- Randomly insert NAs into dataframe proportionaly
- How to delete rows where all the columns are zero
- R: Split unbalanced list in data.frame column
- Transposing a dataframe maintaining the first column as heading
- Should I use a data.frame or a matrix?
- Split dataframe using two columns of data and apply common transformation on list of resulting dataframes
- Replace values in data frame based on other data frame in R
- Add an image to a table-like output in R
- Convert a data frame to a data.table without copy
- Shifting a column down by one
- Identifying where value changes in R data.frame column