[16] print.checkDocStyle
[17] print.check_dotInternal
[18] print.checkFF
[19] print.check_make_vars
[20] print.check_package_code_syntax*
...
Asterisks denotenonvisiblefunctions, meaning ones that are not in the
default namespaces. You can find these functions viagetAnywhere()and then
access them by using a namespace qualifier. An example isprint.aspell().
Theaspell()function itself does a spellcheck on the file specified in its argu-
ment. For example, suppose the filewrdsconsists of this line:
Which word is mispelled?
In this case, this function will catch the misspelled word, as follows:
aspell("wrds")
mispelled
wrds:1:15
The output says that there is the indicated spelling error in line 1, char-
acter 15 of the input file. But what concerns us here is the mechanism by
which that output was printed.
Theaspell()function returns an object of class"aspell", which does
have its own generic print function,print.aspell(). In fact, that function was
invoked in our example, after the call toaspell(), and the return value was
printed out. At that time, R calledUseMethod()on the object of class"aspell".
But if we call that print method directly, R won’t recognize it:
aspout <- aspell("wrds")
print.aspell(aspout)
Error: could not find function "print.aspell"
However, we can find it by callinggetAnywhere():
getAnywhere(print.aspell)
A single object matching 'print.aspell' was found
It was found in the following places
registered S3 method for print from namespace utils
namespace:utils
with value
function (x, sort = TRUE, verbose = FALSE, indent = 2L, ...)
{
if (!(nr <- nrow(x)))
...
Object-Oriented Programming 211