Constructer of the bstr class object

bstr(x, n, ucase = FALSE)

dstr(x, n, ucase = FALSE)

astr(x, n, ucase = F)

is_bstr(x)

is_dstr(x)

is_astr(x)

as_bstr(x, n, ucase = FALSE)

as_dstr(x, n, ucase = FALSE)

as_astr(x, n, ucase = FALSE)

Arguments

x

A character vector which convert to a bstr object.

n

A character vector which is name of x.

ucase

A logical. If TRUE the x is converted to upper case. (default: FALSE)

Examples

bstr("Apple", "apple")
#> class: bstr,character #> number of sequences: 1 #> [1] apple : Apple 5
bstr(c("Apple", "potato"), c("apple", "imo"), ucase = TRUE)
#> class: bstr,character #> number of sequences: 2 #> [1] apple : APPLE 5 #> [2] imo : POTATO 6
dstr("A.Bad.bat", "It is")
#> class: dstr,bstr,character #> number of sequences: 1 #> [1] It is : A.Bad.bat 9
dstr(c("A", "bad", "Bat"), ucase = TRUE)
#> class: dstr,bstr,character #> number of sequences: 3 #> [1] no name 1 : A 1 #> [2] no name 2 : BAD 3 #> [3] no name 3 : BAT 3
astr("Wqrld", "HELLQ", ucase = TRUE)
#> class: astr,bstr,character #> number of sequences: 1 #> [1] HELLQ : WQRLD 5
### Check class is_bstr(bstr("apple"))
#> [1] TRUE
is_bstr(c("apple", "orange"))
#> [1] FALSE
is_dstr(dstr("bad"))
#> [1] TRUE
is_astr(astr("I.am.a.geek"))
#> [1] TRUE
### Convert character to bstr object as_dstr("bad", "good", ucase = TRUE)
#> class: dstr,bstr,character #> number of sequences: 1 #> [1] good : BAD 3
# as_dstr(c("good", "bad")) # Error as_astr("Wqrld", "HELLQ", ucase = TRUE)
#> class: astr,bstr,character #> number of sequences: 1 #> [1] HELLQ : WQRLD 5