Last 5 Pages Viewed: Special:RecentChangesLinked/Short read n... » Special:RecentChangesLinked/BOAT algorit... » N50 N90 calculation using Perl code » Short read nucleotide sequence mapping a... » Simple functions

Simple functions

From kogic.kr

YalPak_Rtip

Split the elements of a character vector and select an element

Input

x <- "AAA@BBB"

Code

split_pick <- function(x , Div_str, Pick_num){

    return(as.character(as.data.table(strsplit(x, Div_str))[Pick_num])) 

}
split_pick(x, "@", 2)

Output

"BBB"