On 11/17/2016 04:49 PM, Jeff Newmiller wrote:
require(tfplot)
tfplot(x.ts)
Would just like to point out that require() should not be treated as
interchangeable with library(). The former returns a logical status
indicating success or failure, while the latter throws an error if it
falls. You should reserve use of require() for cases when you are
implementing an alternative path of execution for failure, and in
nearly all usual cases use the library() function instead so hapless
users of your script don't have to sift through all the subsequent
errors to figure out the problem.
Mea culpa. Force of habit from usually writing with an alternative path
of execution. In this example I should have used library(), especially
since 'tfplot' may not have been installed on the user's system and so
the library() error message would be more explicit than the warning from
require(). But "in nearly all usual cases" seems a bit strong. It
implies R users don't usually program much and thus do not implement an
alternative path of execution for failure. (Some of us consider that the
most usual case.)
Paul
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.