I have 2 dataframes. Both of them have the same columns names, but the first one has more variables than the second one. I want to know which columns match on both DFs or which columns are in the first DF that are not in the second one
welcome to SO!
You can modify this code to help answer your question. Check out ?setdiff
for more information on that command.
vars1 <- colnames(dataframe1)
vars2 <- colnames(dataframe2)
setdiff(vars1, vars2)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.