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) 
Community
  • 1
  • 1
M.Qasim
  • 1,827
  • 4
  • 33
  • 58
  • 1
    Let's not start overusing the word "exact". This question can be answered by reading the material in that post. – Señor O Nov 26 '12 at 05:23

1 Answers1

48

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

sashkello
  • 17,306
  • 24
  • 81
  • 109