R/asc.R

Defines functions asc

Documented in asc

#' asc returns the codes (in UTF-8) of a string
#' @title Return the codes (in UTF-8) of a string
#' @author Based on this blog: http://datadebrief.blogspot.com/2011/03/ascii-code-table-in-r.html
#' @return A vector with ITF-8 codes of a string
#' @param x The string to be analyzed
#' @description Return the codes (in UTF-8) of a string.
#' @family Characters
#' @examples
#' asc("abcd")
#' asc("ABCD")
#' @export

asc <- function(x) {strtoi(charToRaw(x),16L) }

Try the HelpersMG package in your browser

Any scripts or data that you put into this service are public.

HelpersMG documentation built on Oct. 5, 2023, 5:08 p.m.