[R] delay evaluation of expression

William Dunlap wdunlap at tibco.com
Tue Apr 29 02:47:11 CEST 2014


> I have tried, but it doesn't help because when you use the load_all()
> function of devtools,
> the datasets are not lazyLoaded but fully evaluated..

Does LazyLoad:yes in yourPackage/DESCRIPTION work for you when you use
the command line 'R CMD INSTALL yourPackage?

I don't use devtools, but perhaps you should ask its author about how
to do what you want.

Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 28, 2014 at 3:21 PM, Luca Cerone <luca.cerone at gmail.com> wrote:
> Hi William,
> I have tried, but it doesn't help because when you use the load_all()
> function of devtools,
> the datasets are not lazyLoaded but fully evaluated..
>
> I have solved for the moment saving them as rds files (saveRDS()) and
> using the function delayedAssign()
>
> I was wondering if there is some better way to manage this, though.
>
> Thanks for your help,
> Luca
>
> 2014-04-29 0:06 GMT+02:00 William Dunlap <wdunlap at tibco.com>:
>> Have you tried putting the line
>>   LazyData; true
>> (or yes) into your package's DESCRIPTION file?
>>
>> See 'Writing R Extensions', section 1.1.6 'Data in packages.'
>>
>>
>> Bill Dunlap
>> TIBCO Software
>> wdunlap tibco.com
>>
>>
>> On Mon, Apr 28, 2014 at 12:45 AM, Luca Cerone <luca.cerone at gmail.com> wrote:
>>> Dear all,
>>> in one of my packages I need to load some data from .Rdata files that
>>> are to be used from
>>> some functions (but not all off them). I would like to delay the
>>> loading of this datasets
>>> only when needed. In other cases I successfully used lazyLoad and
>>> delayedAssign(),
>>> but when I try to load a .Rdata file I get this message: Error: cannot
>>> add bindings to a locked environment
>>>
>>> What would be the best way to load such a db only the first time that is needed?
>>> Thanks a lot for you help,
>>>
>>> Cheers,
>>> Luca
>>>
>>> ______________________________________________
>>> R-help at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>
>
>
> --
> Luca Cerone
>
> Tel: +34 692 06 71 28
> Skype: luca.cerone



More information about the R-help mailing list