how to remove rows and columns from a dataframe in r code example Example: r remove row dataframe myData[-c(2, 4, 6), ] # remove rows 2, 4, 6