[Bioc-devel] LazyData in DESCRIPTION file

Kasper Daniel Hansen k@@perd@n|e|h@n@en @end|ng |rom gm@||@com
Thu Apr 30 14:55:09 CEST 2020


If you don't have lazy data on, you should be able to load the data by
using data().  Let us say you example data is called expData.

With lazy data
  print(expData)

Without lazy data you need explicit loading
  data(expData)
  print(expData)

For the purpose of examples, there is also a user-level advantage of using
an explicit data() statement: the user can see that the data comes from
somewhere, instead of appearing out of nowhere. For examples, I actually
only see advantages of not using lazyData, because of these explicit
statements.

My historical impression: I would say that when lazyData was introduced, it
seems to me that the intention was widespread use. It seems to me that the
tides have turned against lazy data and the official recommendation is to
not use it unless you have good reasons.  One disadvantage with widespread
use of lazyData is that the names of these objects have to be accessible
somewhere.

Note: one thing I have realized very belatedly is that the lazyData field
is a boolean, the right statements are one of
  lazyData: TRUE
  lazyData: FALSE
For example, I think it has to be all uppercase.

Best,
Kasper

On Wed, Apr 29, 2020 at 6:05 PM Vincent Carey <stvjc using channing.harvard.edu>
wrote:

> I see this is guideline 7 at
> https://bioconductor.org/developers/package-guidelines/
>
> I have used LazyData: TRUE so that [pkgname]::[entity] can be used instead
> of data().  The
> claim that it is "rarely a good thing" and slows down package loading can
> be weighed against
> convenience.  I am not sure you should use LazyData to avoid a
> documentation warning
> however.  Can you give more details on what package is generating the
> warning?
>
> On Wed, Apr 29, 2020 at 5:34 PM Vinh Tran <tran using bio.uni-frankfurt.de>
> wrote:
>
> > Dear Bioc members,
> >
> > I have just encountered a warning during the CHECK that some data objects
> > are used in the documents but not in code (e.g. “Variables with usage in
> > documentation object ‘ppTree’ but not in code"). They are the demo data,
> > that I am using only in the examples for demonstrate the usage of some
> > functions. Adding LazyData: True to the DESCRIPTION can solve that issue,
> > but according to the package guidelines it is not recommended. Could you
> > please show me what should I do in this case? The demo data is only about
> > 15 KB at max.
> >
> > Many thanks for your advices!
> >
> > Best regards,
> > Vinh
> >
> > --------------------------------
> > Dr. Vinh Tran
> >
> > Dept. for Applied Bioinformatics
> > Inst. for Cell Biology and Neuroscience
> > Goethe University Frankfurt
> >
> > Biologicum, Room 3.209
> > Phone +49 (0)69/798-42118
> >
> >
> >         [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > Bioc-devel using r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/bioc-devel
> >
>
> --
> The information in this e-mail is intended only for th...{{dropped:15}}



More information about the Bioc-devel mailing list