Art of R Programming by Norman Matloff

Art of R Programming by Norman Matloff

Author:Norman Matloff
Language: eng
Format: mobi, epub
Tags: COMPUTERS / Mathematical & Statistical Software
ISBN: 9781593274108
Publisher: No Starch Press
Published: 2011-09-29T22:00:00+00:00


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, character 15 of the input file. But what concerns us here is the mechanism by which that output was printed.

The aspell() 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 to aspell(), and the return value was printed out. At that time, R called UseMethod() on the object of class "aspell". But if we call that print method directly, R won’t recognize it:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.