Description Usage Arguments Value Author(s) Examples
View source: R/substr_by_cha.R
This is a handy function to divide character strings given a certain character. This is especially useful when sometimes gene names show up in the form of "GENESYMBOL|ENTREZID"
1 | substr_by_cha(cha_str, delim = "|", type = c("before", "after"))
|
cha_str |
A character string or a vector of character string. |
delim |
Delimiter character. Default is "|". |
type |
Return the partial character string before or after the delimiter. |
Return the desired substring (an individual or a vector).
Yuhang Liu, Xing Qiu, Jinfeng Zhang, and Zihan Cui
1 2 3 4 | substr_by_cha("ABCB1|5243", delim = "|", type = "before")
## [1] "ABCB1"
substr_by_cha(c("ABCB1-5243", "ABL1-25", "ABL2-27"), delim = "-", type = "after")
## [1] "5243" "25" "27"
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.