Answers for "remove a row in r"

R
4

r remove row dataframe

myData[-c(2, 4, 6), ]   # remove rows 2, 4, 6
Posted by: Guest on July-08-2020
1

remove rownumbers r

rownames(data) <- c()
Posted by: Guest on March-13-2020
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

r remove inf values

df <- df[!is.infinite(rowSums(df)),]
Posted by: Guest on May-30-2020

Browse Popular Code Answers by Language