Skip to content

Fix R CMD check WARNINGs blocking CRAN submission #74

@WestonVoglesonger

Description

@WestonVoglesonger

R CMD check --as-cran on main currently reports 4 WARNINGs (consistent across ubuntu/macos/windows, all R versions), which block CRAN submission (#31). The cran-comments.md template still claims "0 warnings", so it's out of date.

Warnings

  1. LazyDataLazyData DB of 13.6 MB without LazyDataCompression set. Fix: add LazyDataCompression: xz to DESCRIPTION.
  2. namespace references in data filesdata/fit_sim.rda: lubridate. Root cause (verified by walking the object): fit_sim does not contain a lubridate-classed value. The reference lives in stanfit@.MISC$stan_fit_instance (the compiled-model Rcpp instance), whose captured environment references the lubridate namespace. It was captured because data-raw/DATASET.R runs library(tidyverse) (attaching lubridate) when it calls sampling(). imuGAP's own code never uses lubridate (not in R/, NAMESPACE, or DESCRIPTION).
  3. Rd \usageUndocumented arguments in Rd file 'create_target.Rd': 'mode'. The mode arg (added in export create_target and add a new mode #63) lacks a roxygen @param mode.
  4. installWarning: namespace 'lubridate' is not available and has been replaced. Same root cause as attempt the NC application of the pipeline (JHU has a good draft) #2: loading fit_sim resolves the captured lubridate reference, which warns when lubridate isn't installed.

Fix (no re-sampling required)

Verified that stanfit@.MISC is a disposable cache: predict() reconstructs what it needs from @stanmodel via gqs(). Blanking .MISC and re-saving keeps predict working (4000-row output) and removes the lubridate reference entirely — the posterior draws are untouched, so no downstream test values shift.

(Rejected alternative: adding lubridate to Imports would silence #2/#4 but declares an unused dependency and leaves the leak in the fixture.)

Also seen (NOTE, non-blocking)

Acceptance

  • R CMD check --as-cran = 0 errors, 0 warnings on all CI platforms
  • fit_sim still drives predict examples/tests after the scrub
  • cran-comments.md updated with the real note count

Refs #31

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions