I have a data.frame with the name “abcframe”
a b c
1 1 1
2 2 3
How might I find whether a column exists or not in a given data frame?
For example, I would like to find whether a column d exists in the data.frame abcframe.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming that the name of your data frame is
datand that your column name to check is"d", you can use the%in%operator: