[Bioc-devel] best practice for storing long error message in R package
Joris Meys
Joris.Meys at Ugent.be
Wed Mar 9 16:46:37 CET 2016
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:
> hi,
>
> I have a long error message I want to print out after failing on some
> condition, but don't want this long message taking up space in the
> body of the function. I'm curious what other developers think would be
> best practice for where/how to store this message content in a
> package.
>
> best,
> Mike
>
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>
--
Joris Meys
Statistical consultant
Ghent University
Faculty of Bioscience Engineering
Department of Mathematical Modelling, Statistics and Bio-Informatics
tel : +32 9 264 59 87
Joris.Meys at Ugent.be
-------------------------------
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php
[[alternative HTML version deleted]]
More information about the Bioc-devel
mailing list