Skip to content

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

3 messages · Kristian Hovde Liland, 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
#
Hi Sanjeev,

I do not think that R cares what name your data file has, only what name the object inside has. In your case you are documenting sample_chr21_vcf while R sees the object inside, vcf_data. In other words, you have documented something that is not included and not documented something that is included.

I prefer having the same name for the data file and the object inside to avoid confusion.

Best regards,
Kristian

Fra: R-package-devel <r-package-devel-bounces at r-project.org> p? vegne av Sanjeev Sariya <sanjeevsariya at gmail.com>
Dato: torsdag, 22. desember 2022 kl. 07:57
Til: r-package-devel at r-project.org <r-package-devel at r-project.org>
Emne: [R-pkg-devel] warning about object name and object not being used
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


______________________________________________
R-package-devel at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel
2 days later
#
Hello Kristian,

Thank you for your reply. That helps a lot.
Happy and safe Holidays.

--
Sanjeev M

On Thu, 22 Dec, 2022, 1:32 pm Kristian Hovde Liland, <
kristian.liland at nmbu.no> wrote: