Skip to content

[Copilot]: Hotfix CRAN failures (row names contain missing values) #602

@rempsyc

Description

@rempsyc

Task description

We have received the following message from CRAN:

Dear maintainer,

Please see the problems shown on
https://cran.r-project.org/web/checks/check_results_report.html.

The ERRORs for the r-devel checks are from

r89982 | maechler | 2026-04-30 17:07:31 +0200 (Thu, 30 Apr 2026) | 1 line
as.data.frame.*(): also error on explicit row.names with NAs

Please correct before 2026-05-25 to safely retain your package on CRAN.

Best wishes,
The CRAN Team

Version: 0.6.3
Check: examples
Result: ERROR 
  Running examples inreport-Ex.Rfailed
  The error most likely occurred in:
  
  > ### Name: report_participants
  > ### Title: Reporting the participant data
  > ### Aliases: report_participants
  > 
  > ### ** Examples
  > 
  > library(report)
  > data <- data.frame(
  +   "Age" = c(22, 23, 54, 21, 8, 42),
  +   "Sex" = c("Intersex", "F", "M", "M", "NA", NA),
  +   "Gender" = c("N", "W", "W", "M", "NA", NA)
  + )
  > report_participants(data, age = "Age", sex = "Sex")
  [1] "6 participants (Mean age = 28.3, SD = 16.6, range: [8, 54]; Sex: 16.7% females, 33.3% males, 16.7% other, 33.33% missing; Gender: 33.3% women, 16.7% men, 16.67% non-binary, 33.33% missing)"
  > 
  > # Years of education (relative to high school graduation)
  > data$Education <- c(0, 8, -3, -5, 3, 5)
  > report_participants(data,
  +   age = "Age", sex = "Sex", gender = "Gender",
  +   education = "Education"
  + )
  [1] "6 participants (Mean age = 28.3, SD = 16.6, range: [8, 54]; Sex: 16.7% females, 33.3% males, 16.7% other, 33.33% missing; Gender: 33.3% women, 16.7% men, 16.67% non-binary, 33.33% missing; Mean education = 1.3, SD = 4.9, range: [-5, 8])"
  > 
  > # Education as factor
  > data$Education2 <- c(
  +   "Bachelor", "PhD", "Highschool",
  +   "Highschool", "Bachelor", "Bachelor"
  + )
  > report_participants(data, age = "Age", sex = "Sex", gender = "Gender", education = "Education2")
  [1] "6 participants (Mean age = 28.3, SD = 16.6, range: [8, 54]; Sex: 16.7% females, 33.3% males, 16.7% other, 33.33% missing; Gender: 33.3% women, 16.7% men, 16.67% non-binary, 33.33% missing; Education: Bachelor, 50.00%; Highschool, 33.33%; PhD, 16.67%)"
  > 
  > # Country
  > data <- data.frame(
  +   "Age" = c(22, 23, 54, 21, 8, 42, 18, 32, 24, 27, 45),
  +   "Sex" = c("Intersex", "F", "F", "M", "M", "M", "F", "F", "F", "F", "F"),
  +   "Gender" = c("N", "W", "W", "M", "M", "M", "W", "W", "W", "W", "W"),
  +   "Country" = c(
  +     "USA", NA, "Canada", "Canada", "India", "Germany",
  +     "USA", "USA", "USA", "USA", "Canada"
  +   )
  + )
  > report_participants(data)
  Error in as.data.frame.integer(x[[i]], optional = TRUE) : 
    row names contain missing values
  Calls: report_participants ... data.frame -> as.data.frame -> as.data.frame.integer
  Execution halted
Flavors: [r-devel-linux-x86_64-fedora-clang](https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-fedora-clang/report-00check.html), [r-devel-windows-x86_64](https://www.r-project.org/nosvn/R.check/r-devel-windows-x86_64/report-00check.html)

Version: 0.6.3
Check: tests
Result: ERROR 
    Running 'testthat.R' [91s]
  Running the tests in 'tests/testthat.R' failed.
  Complete output:
    > # Generate snapshots only on Windows to avoid having to generate snapshot variant
    > # corresponding to each OS (#312).
    > #
    > # This is especially important for Bayesian models where the results can be different
    > # across OS, and there is no way to specify a threshold when it comes to snapshots
    > # since the values included are of character type.
    > if (tolower(Sys.info()[["sysname"]]) == "windows") {
    +   library(testthat)
    + 
    +   test_check("report")
    + }
    Loading required package: report
    We selected `contrast=c("Species")`.
    Saving _problems/test-report_participants-119.R
    Saving _problems/test-report_participants-142.R
    [ FAIL 2 | WARN 0 | SKIP 48 | PASS 449 ]
    
    ══ Skipped tests (48) ══════════════════════════════════════════════════════════
    • On CRAN (46): 'test-coverage-MixMod.R:4:1', 'test-coverage-brmsfit.R:5:1',
      'test-coverage-compare-loo.R:5:1', 'test-coverage-glmmTMB.R:4:1',
      'test-report.BFBayesFactor.R:2:1', 'test-report.MixMod.R:6:3',
      'test-report.aov.R:1:1', 'test-report.brmsfit.R:1:1',
      'test-report.compare.loo.R:6:3', 'test-report.data.frame.R:33:1',
      'test-report.data.frame.R:61:1', 'test-report.data.frame.R:86:1',
      'test-report.data.frame.R:97:1', 'test-report.glmmTMB.R:4:3',
      'test-report.htest-chi2.R:1:1', 'test-report.htest-chi2.R:103:1',
      'test-report.htest-correlation.R:1:1', 'test-report.htest-fisher.R:1:1',
      'test-report.htest-friedman.R:1:1', 'test-report.htest-kruskal.R:1:1',
      'test-report.htest-t-test.R:1:1', 'test-report.htest-wilcox.R:2:1',
      'test-report.ivreg.R:3:1', 'test-report.lavaan.R:2:1',
      'test-report.lm.R:24:1', 'test-report.lm.R:40:1', 'test-report.lme.R:2:1',
      'test-report.lmer.R:2:1', 'test-report.stanreg.R:2:1',
      'test-report.survreg.R:1:1', 'test-report_participants.R:158:1',
      'test-report_participants.R:169:1', 'test-report_performance.R:70:1',
      'test-report_s.R:1:1', 'test-report_sample.R:64:1',
      'test-report_sample.R:79:1', 'test-report_sample.R:99:1',
      'test-report_sample.R:159:1', 'test-report_sample.R:174:1',
      'test-report_sample.R:201:1', 'test-report_sample.R:216:1',
      'test-report_sample.R:231:1', 'test-report_sample.R:258:1',
      'test-report_sample.R:273:1', 'test-report_sample.R:294:1',
      'test-report_sample.R:321:1'Skipping because of a .01 decimal difference in snapshots (2):
      'test-report.lm.R:6:3', 'test-report_performance.R:135:3'
    
    ══ Failed tests ════════════════════════════════════════════════════════════════
    ── Error ('test-report_participants.R:116:3'): report_participants ─────────────
    Error in `as.data.frame.integer(x[[i]], optional = TRUE)`: row names contain missing values
    Backtrace:1. └─report::report_participants(data4)
      2.   └─report:::.report_participants(...)
      3.     ├─base::as.data.frame(...)
      4.     ├─datawizard::data_tabulate(data[[country]])
      5.     └─datawizard:::data_tabulate.default(data[[country]])
      6.       ├─datawizard::data_rename(...)
      7.       │ └─base::is.data.frame(data)
      8.       └─base::data.frame(freq_table, stringsAsFactors = FALSE)
      9.         ├─base::as.data.frame(x[[i]], optional = TRUE)
     10.         └─base::as.data.frame.table(x[[i]], optional = TRUE)
     11.           ├─base::eval(ex)
     12.           │ └─base::eval(ex)
     13.           └─base::data.frame(...)
     14.             ├─base::as.data.frame(x[[i]], optional = TRUE)
     15.             └─base::as.data.frame.integer(x[[i]], optional = TRUE)
    ── Error ('test-report_participants.R:139:3'): report_participants test NAs no warning ──
    Error in `as.data.frame.integer(x[[i]], optional = TRUE)`: row names contain missing values
    Backtrace:1. └─report::report_participants(data)
      2.   └─report:::.report_participants(...)
      3.     ├─base::as.data.frame(...)
      4.     ├─datawizard::data_tabulate(data[[country]])
      5.     └─datawizard:::data_tabulate.default(data[[country]])
      6.       ├─datawizard::data_rename(...)
      7.       │ └─base::is.data.frame(data)
      8.       └─base::data.frame(freq_table, stringsAsFactors = FALSE)
      9.         ├─base::as.data.frame(x[[i]], optional = TRUE)
     10.         └─base::as.data.frame.table(x[[i]], optional = TRUE)
     11.           ├─base::eval(ex)
     12.           │ └─base::eval(ex)
     13.           └─base::data.frame(...)
     14.             ├─base::as.data.frame(x[[i]], optional = TRUE)
     15.             └─base::as.data.frame.integer(x[[i]], optional = TRUE)
    
    [ FAIL 2 | WARN 0 | SKIP 48 | PASS 449 ]
    Error:
    ! Test failures.
    Execution halted
Flavor: [r-devel-windows-x86_64](https://www.r-project.org/nosvn/R.check/r-devel-windows-x86_64/report-00check.html)

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions