R: ascii2char: Converting ASCII encoded values to character...
ascii2char
R Documentation
ascii2char: Converting ASCII encoded values to character values.
Description
ascii2char calculates character representations for given phred values.
char2ascii returns phred values for given ASCII encoded
representations (the reverse transformation of ascii2char).
Usage
ascii2char(x, multiple=FALSE)
char2ascii(c)
Arguments
x
numeric. Vector with ASCII values. All values must be in
1:255. Other values produce an error.
multiple
logical. For 'FALSE' (the default), all
characters are combined into one single string (i.e. a character vector
of length 1). For 'TRUE', single characters are combined into
a vector.
c
character. Vector of length 1 (Longer vectors will
generate Warnings).
Details
The functions are only wrappers for convenience. char2ascii
is defined as strtoi(charToRaw(c), base = 16L). ascii2char
is defined as rawToChar(as.raw(x), multiple).
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(seqTools)
Loading required package: zlibbioc
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/seqTools/ascii2char.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ascii2char
> ### Title: ascii2char: Converting ASCII encoded values to character values.
> ### Aliases: ascii2char char2ascii
> ### Keywords: ascii2char
>
> ### ** Examples
>
> ascii2char(97:101, multiple=FALSE)
[1] "abcde"
> ascii2char(97:101, multiple=TRUE)
[1] "a" "b" "c" "d" "e"
> char2ascii("abcde")
[1] 97 98 99 100 101
> char2ascii(paste("a", "b", "c", collapse=""))
[1] 97 32 98 32 99
> ascii2char(char2ascii("abcde"))
[1] "abcde"
>
>
>
>
>
> dev.off()
null device
1
>