Search
 
SCRIPT & CODE EXAMPLE
 

R

remove rownumbers r

rownames(data) <- c()
Comment

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 :: skewness in r 
R :: r ddply 
R :: how to read in txt/csv files into r 
R :: sequence r 
R :: r replace na with 0 
R :: convert a datetime to date r 
R :: remove first and last character from string R 
R :: random r 
R :: r function syntax 
R :: plot porportion bar chart in r 
R :: Derive end of the week date in r 
R :: color code in R 
R :: read.table 
R :: calculated defualt values in R function parameters 
R :: read.table tab separator 
R :: number of days in a data set in r 
R :: str_extract all using mutate and toString 
R :: switch variable position in r dplyr 
R :: two letter country code in r 
R :: vector with real numbers R 
R :: How to remove duplicates based on the combinations of two columns r 
Rust :: rust lang sleep 
Rust :: rust implement debug for struct 
Rust :: add element to vec rust 
Rust :: rust hashmap 
Rust :: rust init vec with values 
Rust :: hello world in rust 
Rust :: rust•armanriazi•strring•vs•str 
Rust :: armanriazi•rust•error•[E0782]: trait objects must include the `dyn` keyword 
Rust :: armanriazi•rust•ref•move 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =