two dataframes are identical but the 2nd one could have updated data and also new records
I want to display which rows are new and which rows have been updated ?
example 2 dataframes. the 2nd one has a new rows added and also one of the column values changed for another row
a1 <- structure(list(
key = c("1", "2", "3"),
town = c("Crewe", "Sandbach", "Middlewich"),
area = c("Cheshire","Cheshire", "Cheshire"),
total_pop = c(100, 400, 120)),
row.names = c(NA, -3L),
class = "data.frame")
a2 <- structure(list(
key = c("1", "2", "3","4"),
town = c("Crewe", "Sandbach", "Middlewich","Nantwich"),
area = c("Cheshire","Cheshire", "Cheshire","Cheshire"),
total_pop = c(100, 400, 100,200)),
row.names = c(NA, -4L),
class = "data.frame")
cheers