[R-gregmisc-commits] r2034 - pkg/gtools/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed May 27 02:17:31 CEST 2015


Author: warnes
Date: 2015-05-27 02:17:31 +0200 (Wed, 27 May 2015)
New Revision: 2034

Added:
   pkg/gtools/R/asc.R
Log:
Add asc() and chr() functions for converting between characters and ASCII codes

Added: pkg/gtools/R/asc.R
===================================================================
--- pkg/gtools/R/asc.R	                        (rev 0)
+++ pkg/gtools/R/asc.R	2015-05-27 00:17:31 UTC (rev 2034)
@@ -0,0 +1,2 @@
+asc <- function(char) sapply(char, function(x) strtoi(charToRaw(x),16L) )
+chr <- function(n) sapply(n, function(x) rawToChar(as.raw(x)) )



More information about the R-gregmisc-commits mailing list