[Rd] [Q] R CMD check signals error on code that works from UI

Paul Roebuck plroebuck at mdanderson.org
Thu Jan 15 18:50:05 CET 2009


Add the following to example section of a dot-Rd manpage:

## :WHY: The following kills R CMD check but runs fine on console.
foos <- c("aaa", "bbb", "ccc")
cat(sapply(foos,
           function(foo) {
               sprintf("name: %-18s upper: %s\n",
                       foo,
                       toupper(foo))
           }), sep="")


R CMD check <package> stops with error:

...
* checking examples ... ERROR
Running examples in '<package>-Ex.R' failed.
The error most likely occurred in:
   ...
>
> ## :WHY: The following kills R CMD check but runs fine on console.
> foos <- c("aaa", "bbb", "ccc")
> cat(sapply(foos,
+            function(foo) {
+                sprintf("name:
+                        foo,
+                        toupper(foo))
+            }), sep="")
+
+
+
+ cleanEx(); nameEx("sc80-registerNormalizationMethod")
Error: unexpected string constant in:
"
cleanEx(); nameEx(""
Execution halted


Yet on console, it provides the expected:

name: aaa                upper: AAA
name: bbb                upper: BBB
name: ccc                upper: CCC


How do I work around this for manpage?


----------------------------------------------------------
SIGSIG -- signature too long (core dumped)



More information about the R-devel mailing list