haotu : an open lab notebook

2018/01/31

save the first (or any) element of a string split

Filed under: errors in R, Manipulate Data in R, R, R, R Stats — Tags: , — S @ 06:58
dirs<-matrix(ncol = 2,data=unlist(strsplit(out$`Full Name`,split=",")),byrow = TRUE)[,1]
Advertisements

2018/01/29

Replace . in string in R

Filed under: errors in R, Manipulate Data in R, R, R, R Stats — Tags: — S @ 07:54
gsub(x = ff,pattern = "[.]",replacement="")

2018/01/25

dplyr column names with spaces, how to index

Filed under: Manipulate Data in R, R, R, R Stats — Tags: , , — S @ 09:12

backtick it!

`my name`

https://stackoverflow.com/questions/22842232/dplyr-select-column-names-containing-white-space

2018/01/03

All Pairwise Combinations of Rownames from a Square Matrix

Filed under: R, R, R spatial, R Stats, Uncategorized — Tags: , , , — S @ 12:37
combn(rownames(my.square.matrix), m=2, FUN=paste, collapse = "-", simplify = T)

Blog at WordPress.com.