Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

charToInt

Converts a vector of ASCII characters into a vector of integers


Description

Converts a vector of ASCII characters to a equal length vector of ASCII integers.

Usage

## Default S3 method:
charToInt(ch, ...)

Arguments

ch

A character vector.

...

Not used.

Value

Returns an ASCII integer vector.

Author(s)

Henrik Bengtsson

See Also

Examples

i <- charToInt(unlist(strsplit("Hello world!", split=NULL)))
  # Gives: 72 101 108 108 111  32 119 111 114 108 100  33
  ch <- intToChar(c(72,101,108,108,111,32,119,111,114,108,100,33))
  # Gives: "H" "e" "l" "l" "o" " " "w" "o" "r" "l" "d" "!"

R.oo

R Object-Oriented Programming with or without References

v1.24.0
LGPL (>= 2.1)
Authors
Henrik Bengtsson [aut, cre, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.