Library/package development - message when loading

package, r

Solution

Yes. You can use the `.onLoad`, `.onAttach`, or `.First.lib` functions to do whatever you want when the package is loaded. I suggest looking at the help for those functions. You would use `.onLoad` with a namespace, and `.First.lib` without.

One convention is that people will frequently put these commands in a separate `zzz.R` file, which is just used for package related code.

Problem

is there any way to display a message when a user loads `library(myCustomLibrary)`? Upon loading, I want to display a message that tells the user how to run all the test functions.

Original source