[Rd] ASCIIfy() - a proposal for package:tools

Duncan Murdoch murdoch.duncan at gmail.com
Thu Apr 17 15:46:33 CEST 2014


Nobody else has replied to this, so I will.  It's very unlikely that we 
would incorporate this function into base R.  For one thing, the tools 
package is intended to be tools used by R, not by users.  R doesn't need 
this function, so it doesn't belong in tools.  (Some other functions in 
tools like showNonASCII have come to be used by users, but their primary 
purpose is for R.)

Utility functions that are maintained by R Core and are useful to users 
belong in the utils package.  But I wouldn't add ASCIIfy to that package 
either, because I don't want to impose its maintenance on R Core.

Utility functions that are maintained by others belong in contributed 
packages.  So I'd suggest that you add this function to some package 
that you maintain (perhaps a new one, containing a collection of related 
utility functions), or search CRAN for an appropriate package with a 
maintainer who is willing to take this on.

Duncan Murdoch

On 15/04/2014 1:48 PM, Arni Magnusson wrote:
> Hi all,
>
> I would like to propose the attached function ASCIIfy() to be added to the
> 'tools' package.
>
> Non-ASCII characters in character vectors can be problematic for R
> packages, but sometimes they cannot be avoided. To make packages portable
> and build without 'R CMD check' warnings, my solution has been to convert
> problematic characters in functions and datasets to escaped ASCII, so
> plot(1,main="São Paulo") becomes plot(1,main="S\u00e3o Paulo").
>
> The showNonASCII() function in package:tools is helpful to identify R
> source files where characters should be converted to ASCII one way or
> another, but I could not find a function to actually perform the
> conversion to ASCII.
>
> I have written the function ASCIIfy() to convert character vectors to
> ASCII. I imagine other R package developers might be looking for a similar
> tool, and it seems to me that package:tools is the first place they would
> look, where the R Core Team has provided a variety of tools for handling
> non-ASCII characters in package development.
>
> I hope the R Core Team will adopt ASCIIfy() into the 'tools' package, to
> make life easier for package developers outside the English-speaking
> world. I have of course no problem with them renaming or rewriting the
> function in any way.
>
> See the attached examples - all in flat ASCII that was prepared using the
> function itself! The main objective, though, is to ASCIIfy functions and
> datasets, not help pages.
>
> Arni
>
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list