Credits go to @ericOss, anti_join is the easiest way
Sample data
Next time either provide your data (or build a small example set as I did):
library(zipcode)
data(zipcode)
# Data
df1 <- head(zipcode)
df2 <- head(zipcode)
# Remove some things
df2[2,1] <- 0000 #wrong zip
df2[4,3] <- 'FOO' # wrong stat
df1
zip city state latitude longitude
1 00210 Portsmouth NH 43.0059 -71.0132
2 00211 Portsmouth NH 43.0059 -71.0132
3 00212 Portsmouth NH 43.0059 -71.0132
4 00213 Portsmouth NH 43.0059 -71.0132
5 00214 Portsmouth NH 43.0059 -71.0132
6 00215 Portsmouth NH 43.0059 -71.0132
df2
zip city state latitude longitude
1 00210 Portsmouth NH 43.0059 -71.0132
2 0 Portsmouth NH 43.0059 -71.0132
3 00212 Portsmouth NH 43.0059 -71.0132
4 00213 Portsmouth FOO 43.0059 -71.0132
5 00214 Portsmouth NH 43.0059 -71.0132
6 00215 Portsmouth NH 43.0059 -71.0132
Anti_join
Then you can use print(df2 %>% anti_join(df1))
which will give you:
zip city state latitude longitude
1 0 Portsmouth NH 43.0059 -71.0132
2 00213 Portsmouth FOO 43.0059 -71.0132
anti_join() return all rows from x where there are not matching values
in y, keeping just columns from x.
(anti_join comes with dplyr
install it using install.packages("dplyr")
if you haven't already)