Skip to content
Prev 8804 / 21312 Next

[Bioc-devel] best practice for storing long error message in R package

Hi Michael,

objects I need in the namespace of my package that are NOT data and
shouldn't be accessible to the user, are in general stored in a file I call
InternalObjects.R  All I do there is just assign them to a name I can use
further down in the package, eg:

in InternalObjects.R:

mymessage <- "A very long error message"

In aFun.R

aFun <- function(x){ stop(mymessage) }

I use this mechanism to store eg character vectors to match possible
choices, or small data frames that function as a lookup table.  Anything
that might be remotely useful to the user, is better stored using the data
mechanism from the package.

My 2 humble cents.

Cheers
Joris

On Wed, Mar 9, 2016 at 4:19 PM, Michael Love <michaelisaiahlove at gmail.com>
wrote: