I need to display a failure message when downloading my package. After reading the posts
Library / Package Development - Download Message
Downloading Various Packages Using .onLoad
Now I have a file zzz.Rcontaining only
.onLoad <- function(libname, pkgname){
packageStartupMessage('Regarding data obtained from www.retrosheet.org:\n
The information used here was obtained free of charge from
and is copyrighted by Retrosheet. Interested parties may
contact Retrosheet at "www.retrosheet.org"', domain = NULL, appendLF = TRUE)
}
I have two questions:
As a check, I run the following code. A message when starting the package appears when using install, but not when calling library, which I expect.
> library(devtools)
> install()
...
Reloading installed saber
Regarding data obtained from www.retrosheet.org:
The information used here was obtained free of charge from
and is copyrighted by Retrosheet. Interested parties may
contact Retrosheet at "www.retrosheet.org"
...
> detach(package:saber)
> library(saber)
Attaching package: ‘saber’
The following objects are masked _by_ ‘.GlobalEnv’:
getTeamData, relatedBatting