Answers for "r remove element from matrix"

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

del row matrix r

t1<- t1[-4:-6,-7:-9]
Posted by: Guest on November-27-2020

Browse Popular Code Answers by Language