Skip to contents

A simple function to transform a string into character vector.

Usage

str2chr(x, split = "", ...)

# S4 method for character
str2chr(x, split = "", ...)

# S4 method for list
str2chr(x, split = "", num.cores = 1L, tasks = 0L, verbose = FALSE, ...)

Arguments

x

A character string or a list/vector of character strings.

split

The same as in strsplit

...

Further parameters for strsplit.

num.cores, tasks

Parameters for parallel computation using package BiocParallel-package: the number of cores to use, i.e. at most how many child processes will be run simultaneously (see bplapply and the number of tasks per job (only for Linux OS).

verbose

If TRUE, prints the function log to stdout.

Value

A character string

Author

Robersy Sanchez https://genomaths.com

Examples

## A character string
str2chr("ATCAGCGGGATCTT")
#>  [1] "A" "T" "C" "A" "G" "C" "G" "G" "G" "A" "T" "C" "T" "T"

## A list of character strings
str2chr(list(str1 = "ATCAGCGGGATCTT", str2 = "CTTCTTCGTCAGGC"))
#> $str1
#>  [1] "A" "T" "C" "A" "G" "C" "G" "G" "G" "A" "T" "C" "T" "T"
#> 
#> $str2
#>  [1] "C" "T" "T" "C" "T" "T" "C" "G" "T" "C" "A" "G" "G" "C"
#>