Answers for "how to delete unwanted rows in r"

R
1

remove row from matrix r

# Remove third row - by row number
MyMatrix <- MyMatrix[-3,]

# Remove third and fifth rows - by feeding the matrix a boolean vector
MyMatrix <- MyMatrix[c(TRUE,TRUE,FALSE,TRUE,FALSE,TRUE),]
Posted by: Guest on August-21-2020
0

delete all rows that contain a string in R

library(dplyr)

df %>% 
  filter(!grepl('REVERSE', Name))
Posted by: Guest on May-24-2020

Code answers related to "how to delete unwanted rows in r"

Browse Popular Code Answers by Language