Possible Duplicate:
Drop Columns R Data frame
Let’s say I have a dataframe with column c1, c2, c3.
I want to list just c1 and c2. How do I do that?
I’ve tried:
head(data[column!="c3"])
head(data)[,2]
head(data[!"c3"])
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.
You can index and use a negative sign to drop the 3rd column:
Or you can list only the first 2 columns:
Don’t forget the comma and referencing data frames works like this:
data[row,column]