From edd at debian.org  Sun Apr  8 15:07:34 2012
From: edd at debian.org (Dirk Eddelbuettel)
Date: Sun, 8 Apr 2012 08:07:34 -0500
Subject: [Rd] Display instruction text on package load
In-Reply-To: <CAOC91MTM+YPrsWhX4S31BRJcJ-YJddhGqXxZ8Oc4VngV31vWEQ@mail.gmail.com>
References: <CAOC91MTM+YPrsWhX4S31BRJcJ-YJddhGqXxZ8Oc4VngV31vWEQ@mail.gmail.com>
Message-ID: <20353.36246.573357.907321@max.nulle.part>


On 7 April 2012 at 16:27, Thomas J. Leeper wrote:
| I'm currently working on a new package for R that interfaces with an API.
| Most of the package's functionality requires users to supply an access key
| that allows the package to work with the API. I want to display text
| immediately upon loading the package that instructs/reminds users to enter
| their access key before attempting to do anything (as the package won't
| really work without it). I've searched the relevant help files for creating
| packages but haven't been able find anything about how to do this. As an
| example, library(Zelig) does what I'm trying to achieve.

Start with

      help(packageStartupMessage)
      help(.onLoad)

and also peruse the list archives here---you probably want this in your
.onLoad() function. 

Maybe some of the packages interfacing Google's APIs and webservices have an
example.

Dirk

-- 
R/Finance 2012 Conference on May 11 and 12, 2012 at UIC in Chicago, IL
See agenda, registration details and more at http://www.RinFinance.com



[Rd] Display instruction text on package load
Dirk Eddelbuettel