SyntaxFix
Write A Post
Hire A Developer
Questions
You can index and use a negative sign to drop the 3rd column:
data[,-3]
Or you can list only the first 2 columns:
data[,c("c1", "c2")] data[,1:2]
Don't forget the comma and referencing data frames works like this: data[row,column]