You need the %in%
operator. So,
df1[!(df1$name %in% df2$name),]
should give you what you want.
df1$name %in% df2$name
tests whether the values indf1$name
are indf2$name
- The
!
operator reverses the result.
More Related Contents:
- duplicates in multiple columns
- Dynamically select data frame columns using $ and a character value
- Simultaneously merge multiple data.frames in a list
- Drop unused factor levels in a subsetted data frame
- Create an empty data.frame
- Merging a lot of data.frames [duplicate]
- Create a group number for each consecutive sequence
- Repeat rows of a data.frame N times
- For each row in an R dataframe
- Replace all occurrences of a string in a data frame
- Convert Named Character Vector to data.frame
- How to add a cumulative column to an R dataframe using dplyr?
- Get last row of each group in R [duplicate]
- Techniques for finding near duplicate records
- Same function over multiple data frames in R
- Create empty data frame with column names by assigning a string vector? [duplicate]
- Add extra level to factors in dataframe
- What is about the first column in R’s dataset mtcars?
- Last Observation Carried Forward In a data frame? [duplicate]
- Determine the data types of a data frame’s columns
- finding close match from data frame 1 in data fame 2
- Combine several data frames in the global environment by row (rbind)
- Changing Million/Billion abbreviations into actual numbers? ie. 5.12M -> 5,120,000 [duplicate]
- Extract text after “/” in a data frame column
- What is difference between dataframe and list in R?
- Define dimensions of an empty dataframe
- use multiple columns as variables with sapply
- Merge overlapping ranges into unique groups, in dataframe
- Deleting specific rows from a data frame
- Count number of non-NA values for every column in a dataframe [duplicate]