[R] R package dev: how to export constant?
Uwe Ligges
ligges at statistik.tu-dortmund.de
Wed Jan 25 11:39:21 CET 2012
On 25.01.2012 11:17, cgenolin wrote:
> Hi Jonas, hi the list
>
>> Try adding
>> LazyData: yes
>> to the DESCRIPTION file.
>
> I am a bit surprise by this answer since I found in writing R extentions,
> that lazydata is ignore since version 2.14.
LazyLoad is ignored, LazyData is not.
> But I have the same problem, I do not manage to export contants. So how can
> I do that?
>
> My constant is MAX_CLUST<- 26.
>
> Shall I define it in a code in the /R/ directories, or in a /data/
> directories? I try both, neither works...
> Shall I mention it in NAMESPACE? How?
>
> Is there a way to make this constant available as soon as the package will
> be loaded without using data()?
Either in Data and say
LazyData: yes
or in the code and export the object from the NAMESPACE, if you need it
outside the NAMESPACE.
Since the constant from above is probbaly only used within the
NAMESPACE; I'd define it in the ./R/ folder in an .R file without
exporting it form the NAMESPACE.
Uwe Ligges
> Thanks
> Christophe
>
> --
> View this message in context: http://r.789695.n4.nabble.com/R-package-dev-how-to-export-constant-tp4305281p4326840.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
More information about the R-help
mailing list