construct_bstr.Rd
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)
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) |
bstr("Apple", "apple")#> class: bstr,character #> number of sequences: 1 #> [1] apple : Apple 5#> class: bstr,character #> number of sequences: 2 #> [1] apple : APPLE 5 #> [2] imo : POTATO 6dstr("A.Bad.bat", "It is")#> class: dstr,bstr,character #> number of sequences: 1 #> [1] It is : A.Bad.bat 9#> 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 3astr("Wqrld", "HELLQ", ucase = TRUE)#> class: astr,bstr,character #> number of sequences: 1 #> [1] HELLQ : WQRLD 5### Check class is_bstr(bstr("apple"))#> [1] TRUE#> [1] FALSEis_dstr(dstr("bad"))#> [1] TRUEis_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