[R-pkg-devel] using package data in package code

Linus Chen ||nu@@|@chen @end|ng |rom gm@||@com
Fri Jun 7 14:33:26 CEST 2019


Dear Duncan,

Thank you very much!

>
> For data, the sysdata.rda file is the easiest solution.  It's for data
> that is used by the functions in the package, not user-visible.  Just
> put x into that file in the package/R directory to make use of it.
>
> You don't need a two-pass solution.  As long as the sysdata.rda file
> stays unmodified, x will be available for code in the package to use as
> it sees fit, without any special handling.  (If x is created from
> complicated source code that changes regularly, I'd go with one of my
> earlier suggestions.)
>

This is exactly the approach I tried first. In my naive mind, this
looks to be the most
natural way, and I thought it SHOULD work. However, it did not work on
my computer...,
and that is why I started to invent ugly work-arounds...

Please see attached a minimal example to reproduce the error message:
object 'x' not found.

Thank you very much!
Lei

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.tgz
Type: application/x-gzip
Size: 737 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-package-devel/attachments/20190607/780853c3/attachment.bin>


More information about the R-package-devel mailing list