18

Possible Duplicate:
Drop Columns R Data frame

Suppose, I have the following dataframe, and want to delete column "dataB" what would be R command for that?

y <- data.frame(k1=c(101,102,103,104,105,106,107,108),
                B=c(11,12,13,NA,NA,16,17,18), 
                dataB=11:18) 
1
  • 1
    Let's not start overusing the word "exact". This question can be answered by reading the material in that post. Commented Nov 26, 2012 at 5:23

1 Answer 1

48

This: y$B <- NULL removes column B from dataframe y.

Sign up to request clarification or add additional context in comments.

1 Comment

See the duplicate question, linked by @mnel above.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.