dataframe remove column as row r code example
Example 1: r remove row dataframe
myData[-c(2, 4, 6), ] # remove rows 2, 4, 6
Example 2: r drop column by name
R> subset(df, select=-c(z,u))
x y
1 1 2
2 2 3
3 3 4
4 4 5
5 5 6
myData[-c(2, 4, 6), ] # remove rows 2, 4, 6
R> subset(df, select=-c(z,u))
x y
1 1 2
2 2 3
3 3 4
4 4 5
5 5 6