Re: [R] Using library in an example

From: Jim Lemon <jim_at_bitwrit.com.au>
Date: Thu, 05 Jun 2008 19:58:14 +1000


Thanks to Dirk and Duncan

Dirk's suggestion of the suppressMessages function unfortunately doesn't quite do the job. The warning message isn't printed, but it is picked up by the check function and leads to a whinge.

Duncan is right - I had an older version of "maps" and installing the new version fixed the problem that was causing the warning in the first place. (My apologies for not including sessionInfo).

So, the outcome is:

  1. If you try to use require or library in help page examples, everything has to work.
  2. If you use require or library, wrap it in suppressPackageStartupMessages so that the "Loading package" message doesn't mess up your elegant code.
  3. Remember that 2) won't stop any errors or warnings from being recorded during package checking, therefore 1).

Is my logic sufficiently circular?

Jim



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 05 Jun 2008 - 10:52:14 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 05 Jun 2008 - 12:30:36 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive