No, not list()
lists.
a <- data.frame(name=old$NAME) a$status <- "old" b <- data.frame(name=allfields[allfields$StateAbbre=="ND",]$name) b$status <- "new" both<-merge(a,b,by="name",all=T)
Make two data frames, one for each list, create a column identifying each one (new
or old
), then join on the common column (name
).
Output:
See also: http://stackoverflow.com/questions/17598134/compare-two-lists-in-r/17599048#17599048