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

Assumption of R>4 in tests #91

Open
MichaelChirico opened this issue Mar 2, 2022 · 0 comments
Open

Assumption of R>4 in tests #91

MichaelChirico opened this issue Mar 2, 2022 · 0 comments

Comments

@MichaelChirico
Copy link

Many tests in test-modules-print.R rely on an implicit assumption of R >= 4.0.0. For example:

expect_equal(ModuleConvertNormal(eg_mat,
digits = 0),
data.frame(col1 = eg_mean,
col2 = " (2140)"))

Uses the default value of stringsAsFactors whereas the source code:

tableone/R/modules-print.R

Lines 257 to 261 in c3cf03c

data.frame(col1 = unname(rowMat[,"mean"]),
col2 = paste0(" (",
ModuleFormatNumericVector(rowMat[,"sd"], digits, formatOptions),
")"),
stringsAsFactors = FALSE)

Explicitly sets the value.

Fixes include:

  1. Bumping the version dependency to R>=4.0.0
  2. Explicitly setting stringsAsFactors=FALSE in the tests
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

1 participant