Michael Friendly
2012-Nov-27 22:17 UTC
[Rd] R CMD check: better diagnosis for non-ASCII characters
[Env: R 2.15.1, Win Xp] Suggestion: Could the R script that checks for non-ASCII characters in R CMD check not give either: (a) a pointer to tools:::showNonASCIIfile, as in, try running tools:::showNonASCIIfile("Battig.Rd") or, (b) perhaps more useful, the result of tools:::showNonASCIIfile(file.Rd) on the offending file(s). I'm frequently bitten by this in preparing .Rd files when I copy/paste references to the .Rd from a .pdf or web link. But it is nearly impossible to see these variant characters in my .Rd files with any editor. This recent example was solved by > tools:::showNonASCIIfile("Battig.Rd") 47: \emph{Journal of Experimental Psychology}, 80 (1969), pp. 1<96>46 but I had to find this function again via ??ascii because it is not exported. -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-2100 x66249 Fax: 416 736-5814 4700 Keele Street Web: http://www.datavis.ca Toronto, ONT M3J 1P3 CANADA
Martin Maechler
2012-Nov-28 11:02 UTC
[Rd] R CMD check: better diagnosis for non-ASCII characters
>>>>> Michael Friendly <friendly at yorku.ca> >>>>> on Tue, 27 Nov 2012 17:17:16 -0500 writes:> [Env: R 2.15.1, Win Xp] > Suggestion: > Could the R script that checks for non-ASCII characters in R CMD check > not give either: > (a) a pointer to tools:::showNonASCIIfile, as in, > try running tools:::showNonASCIIfile("Battig.Rd") > or, > (b) perhaps more useful, the result of tools:::showNonASCIIfile(file.Rd) > on the offending file(s). > I'm frequently bitten by this in preparing .Rd files when I copy/paste > references to the > .Rd from a .pdf or web link. But it is nearly impossible to see these > variant characters > in my .Rd files with any editor. I understand.. {though it is easier with my favorite, Emacs} (Many people outside {North America + UK + ex-"Common Wealth"} encounter such problems even more frequently than you..) > This recent example was solved by >> tools:::showNonASCIIfile("Battig.Rd") > 47: \emph{Journal of Experimental Psychology}, 80 (1969), pp. 1<96>46 > but I had to find this function again via ??ascii because it is not > exported. Hmm..... at first, I started replying saying : As your suggestion '(b)' is probably more work, I personally would aim for '(a)' ... but then really the issue is that *nobody* should suggest functions to anyone if they are not exported and hence can be removed from R (or the relevant package), or get different semantics "any time". HOWEVER, both showNonASCII() and showNonASCIIfile() *are* exported (from tools). So, maybe the reason you did not find them quickly was because "tools" is not among the default (loaded + attached) packages? In any case, I support your suggestion (replacing ":::" by "::" !) and would definitely volunteer to accept patches and then put such an improvement into R. Martin
Michael Friendly
2012-Nov-28 14:16 UTC
[Rd] R CMD check: better diagnosis for non-ASCII characters
On 11/28/2012 6:02 AM, Martin Maechler wrote:> In any case, I support your suggestion (replacing ":::" by "::" !) > and would definitely volunteer to accept patches and then put such an > improvement into R.Thanks, Martin. If you can point me to the source where this is carried out, I can attempt a patch. -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-2100 x66249 Fax: 416 736-5814 4700 Keele Street Web: http://www.datavis.ca Toronto, ONT M3J 1P3 CANADA