Re: [Rd] How to add a welcome message in Package development?

From: Simon Urbanek <>
Date: Fri, 10 Jun 2011 15:10:09 -0400

On Jun 10, 2011, at 2:54 PM, Nipesh Bajaj wrote:

> Dear all, it is my first post in R-devel list, and hope that this is
> the right place to ask question related to package development.
> I have created my first package in Windows through the usual route.
> Now I want to add some ***Welcome message*** as soon as user loads my
> package into their R console, using library() function. However I
> could not figure out where and how should I add this functionality in
> entire package development procedure, and the "Writing R Exts"
> document also seem to be mum on this issue.

Personally, I find "welcome messages" extremely annoying, because if you load a dependency chain of 20 packages and each has something silly to say, you get pages of completely useless output (since you can't read all of them anyway) that tend to interfere with automated scripts. Also anything people tend to say in those is pertinent only once (when the user first sees the message) so the message is pointless most of the time that it's shown. But that's just my opinion.

That said, you can simply use cat() in .First.lib (if your packages has no namespace) or .onAttach or .onLoad (if your packages has a namespace).


> Can somebody help me how to add this functionality in the development
> route of package. I believe this is possible as in many existing
> packages that functionality is present.
> Thanks,
> ______________________________________________
> mailing list
> mailing list Received on Fri 10 Jun 2011 - 19:15:00 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

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 Fri 10 Jun 2011 - 20:10:18 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive