Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running vignettes code: When sourcing ‘ipums-api-nhgis.R’: Error: Invalid ds_spec specification: geog_levels must not contain missing values #80

Closed
barracuda156 opened this issue Jul 12, 2024 · 3 comments

Comments

@barracuda156
Copy link

--->  Testing R-ipumsr
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-ipumsr/R-ipumsr/work/ipumsr-0.8.0" && /opt/local/bin/R CMD check ./ipumsr_0.8.0.tar.gz --no-manual --no-build-vignettes 
* using log directory ‘/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-ipumsr/R-ipumsr/work/ipumsr-0.8.0/ipumsr.Rcheck’
* using R version 4.4.1 (2024-06-14)
* using platform: powerpc-apple-darwin10.0.0d2 (32-bit)
* R was compiled by
    gcc-mp-13 (MacPorts gcc13 13.3.0_0+stdlib_flag) 13.3.0
    GNU Fortran (MacPorts gcc13 13.3.0_0+stdlib_flag) 13.3.0
* running under: OS X Snow Leopard 10.6
* using session charset: UTF-8
* using options ‘--no-manual --no-build-vignettes’
* checking for file ‘ipumsr/DESCRIPTION’ ... OK
* this is package ‘ipumsr’ version ‘0.8.0’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... NOTE
Package suggested but not available for checking: ‘rmapshaper’
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘ipumsr’ can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking files in ‘vignettes’ ... WARNING
Files in the 'vignettes' directory but no files in 'inst/doc':
  ‘cps_select_data.jpg’ ‘fixtures/check-extract-history.yml’
  ‘fixtures/check-extract-info.yml’ ‘fixtures/extract-ready.yml’
  ‘fixtures/micro-sample-ids.yml’
  ‘fixtures/nhgis-metadata-detailed.yml’
  ‘fixtures/nhgis-metadata-summary.yml’ ‘fixtures/submit-extract.yml’
  ‘fixtures/submit-placeholder-extract-usa.yml’
  ‘fixtures/wait-for-extract.yml’ ‘ipums-api-micro.Rmd’
  ‘ipums-api-nhgis.Rmd’ ‘ipums-api.Rmd’ ‘ipums-bigdata.Rmd’
  ‘ipums-read.Rmd’ ‘ipums.Rmd’ ‘microdata_annotated_screenshot.png’
  ‘value-labels.Rmd’
* checking examples ... OK
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
  Running ‘testthat.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... WARNING
Directory 'inst/doc' does not exist.
Package vignettes without corresponding single PDF/HTML:
  ‘ipums-api-micro.Rmd’
  ‘ipums-api-nhgis.Rmd’
  ‘ipums-api.Rmd’
  ‘ipums-bigdata.Rmd’
  ‘ipums-read.Rmd’
  ‘ipums.Rmd’
  ‘value-labels.Rmd’
* checking running R code from vignettes ...
  ‘ipums-api-micro.Rmd’ using ‘UTF-8’... OK
  ‘ipums-api-nhgis.Rmd’ using ‘UTF-8’... failed
  ‘ipums-api.Rmd’ using ‘UTF-8’... OK
  ‘ipums-bigdata.Rmd’ using ‘UTF-8’... OK
  ‘ipums-read.Rmd’ using ‘UTF-8’... OK
  ‘ipums.Rmd’ using ‘UTF-8’... OK
  ‘value-labels.Rmd’ using ‘UTF-8’... OK
 ERROR
Errors in running code in vignettes:
when running code in ‘ipums-api-nhgis.Rmd’
  ...

Shapefiles: us_county_2021_tl2021, us_county_2020_tl2020

> define_extract_nhgis(description = "Invalid extract", 
+     datasets = ds_spec("1900_STF1", data_tables = "NP1"))

  When sourcing ‘ipums-api-nhgis.R’:
Error: Invalid `ds_spec` specification:
✖ `geog_levels` must not contain missing values.
Execution halted

* checking re-building of vignette outputs ... SKIPPED
* DONE

Status: 1 ERROR, 2 WARNINGs, 1 NOTE
@dtburk
Copy link
Collaborator

dtburk commented Jul 12, 2024

If you look at the vignette source of ipums-api-nhgis.Rmd, you'll see that the code throwing an error is an example of an invalid extract specification, so the error is expected. The code is in a chunk with option error = TRUE, which signals that knitr should continue building even in the case of an error. Is there a way to modify your checking routine to recognize knitr chunk options?

@barracuda156
Copy link
Author

If you look at the vignette source of ipums-api-nhgis.Rmd, you'll see that the code throwing an error is an example of an invalid extract specification, so the error is expected. The code is in a chunk with option error = TRUE, which signals that knitr should continue building even in the case of an error. Is there a way to modify your checking routine to recognize knitr chunk options?

Ah, okay, so this is a known issue. Apparently there is a fix: tidyverse/tibble#1575 (comment)

@dtburk
Copy link
Collaborator

dtburk commented Jul 12, 2024

Oh, interesting, I will try the purl option out locally and see if it fixes the issue. Thanks!

@dtburk dtburk closed this as completed in 01e8158 Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants