Re: [R-pkg-devel] How do I enable to show data in inst/extdata in data() || lazy load

2022-12-21 Thread Sanjeev Sariya
@Uwe - OK, makes sense. I will read the file into an object and save it as
a .Rda in the data folder.
Thank you.
--
Sanjeev M




On Tue, Dec 20, 2022 at 2:36 PM Uwe Ligges 
wrote:

>
>
> On 20.12.2022 00:58, Sanjeev Sariya wrote:
> > Hi,
> > thank you for the reply.
> >
> > Do you need this to be a file? Could it be a pre-parsed R object
> > instead?
>
> Yes, and that can go into an .RData file.
>
> Best,
> Uwe Ligges
>
> >
> > I need to provide an external data/file in the R package. This has come
> as
> > a request from F1000 journal editors.
> >
> > One way to solve this could be to write a script that imports the file
> > from inst/extdata using the facilities provided by your package and put
> > it in a file under data/, then document the resulting object.
> >
> >
> > What do you call this step? How do I do this?
> > I thought to loading the file as lazyload, .onload package something?
> >
> > Best,
> > --
> > Sanjeev M
> >
> >
> >
> >
> > On Tue, Dec 20, 2022 at 1:55 AM Ivan Krylov 
> wrote:
> >
> >> On Mon, 19 Dec 2022 20:59:27 +0530
> >> Sanjeev Sariya  wrote:
> >>
> >>> ... I have created a .Rd file.
> >>> I'm interested in listing this file in data() ...
> >>
> >> My understanding is that data() is for R-level objects, and so is
> >> help(), most likely.
> >>
> >> One way to solve this could be to write a script that imports the file
> >> from inst/extdata using the facilities provided by your package and put
> >> it in a file under data/, then document the resulting object. I think
> >> that if you build your package with --no-resave-data, it will remain an
> >> R script that will be run during the data() call. (By default, your R
> >> script will be run during R CMD build and its output will be packaged
> >> into a gzip-compressed RData file.)
> >>
> >> This might go against the guidance at
> >> ,
> >> which says:
> >>
>  R code should be if possible “self-sufficient” and not make use of
>  extra functionality provided by the package, so that the data file
>  can also be used without having to load the package or its namespace
> >>
> >> Do you need this to be a file? Could it be a pre-parsed R object
> >> instead?
> >>
> >> --
> >> Best regards,
> >> Ivan
> >>
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-package-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] warning about object name and object not being used

2022-12-21 Thread Sanjeev Sariya
Hi there,

I get two warnings:

1)
I created a .rda file from a file. The file was read in a variable as
vcf_data.

Warning:

Undocumented code objects:
  'vcf_data'
Undocumented data sets:
  'vcf_data'

I created object as:

vcf_data <- vcfR::read.vcfR("sample_chr21.vcf", verbose=TRUE)

save(*vcf_data*, file='data/sample_chr21_vcf.rda')

I've a sample_chr21_vcf.Rd file in the man folder.

How do I fix the warning about the variable name that was used to save
a .rda file?

2)

* checking for code/documentation mismatches ... WARNING
Variables with usage in documentation object ‘sample_chr21_vcf’ but not in code:
  ‘sample_chr21_vcf’

I do not use this vcf file anywhere, not in any example.

Github link:

https://github.com/sariya/GARCOM/tree/new_test_hello

Log link

https://win-builder.r-project.org/incoming_pretest/GARCOM_1.2.2_20221222_073525/Debian/00check.log

--
Sanjeev M

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel