Search
 
SCRIPT & CODE EXAMPLE
 

R

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),]
Comment

del row matrix r

> x <- matrix(1:9, nrow = 3, dimnames = list(c("X","Y","Z"), c("A","B","C")))
> x
A B C
X 1 4 7
Y 2 5 8
Z 3 6 9
Comment

del row matrix r

> cbind(c(1,2,3),c(4,5,6))
[,1] [,2]
[1,]    1    4
[2,]    2    5
[3,]    3    6
> rbind(c(1,2,3),c(4,5,6))
[,1] [,2] [,3]
[1,]    1    2    3
[2,]    4    5    6
Comment

del row matrix r

t1<- t1[-4:-6,-7:-9]
Comment

PREVIOUS NEXT
Code Example
R :: exp() function R 
R :: Significance codes 
R :: stacked bar plot r with age groups 
R :: extract first element before a character stringr 
R :: how to upload multiple excel files r 
R :: how to count the number of non NA values in R 
R :: convert ratio to numeric in r 
R :: ways to examine model in r 
R :: how to add in R dictionary 
R :: mean of a row dataframe in r 
Rust :: rust reverse range 
Rust :: rust create directory 
Rust :: ignore #[warn(dead_code)] 
Rust :: rust null 
Rust :: rust string contains 
Rust :: rust hashmap 
Rust :: rust round 2 decimal places 
Rust :: rust initialize struct 
Rust :: rust compiler 
Rust :: armanriazi•rust•interior-mutability•vs•inherited-mutability 
Rust :: slice indices are of type usize rust 
Rust :: armanriazi•rust•trait•bound 
Rust :: armanriazi•rust•borrowchecker•lifetime•struct 
Rust :: primitive data types in rust 
Lua :: luau make a rainbow part 
Lua :: luau make kill brick 
Lua :: roblox lua gui drag 
Lua :: roblox pairs 
Lua :: lua random number 
Lua :: how to access an index of a table lua 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =