* using log directory ‘/srv/hornik/tmp/CRAN_pretest/mhqol.Rcheck’ * using R Under development (unstable) (2025-02-24 r87805) * using platform: x86_64-pc-linux-gnu * R was compiled by Debian clang version 19.1.7 (1+b1) Debian flang-new version 19.1.7 (1+b1) * running under: Debian GNU/Linux trixie/sid * using session charset: UTF-8 * checking for file ‘mhqol/DESCRIPTION’ ... OK * this is package ‘mhqol’ version ‘0.3.0’ * package encoding: UTF-8 * checking CRAN incoming feasibility ... [3s/5s] NOTE Maintainer: ‘Stijn Peeters ’ New submission Found the following \keyword or \concept entries which likely give several index terms: File ‘mhqol.Rd’: \keyword{MHQoL,} \keyword{Utility,} File ‘mhqol_LSS.Rd’: \keyword{LSS,} \keyword{MHQoL,} File ‘mhqol_scores_to_states.Rd’: \keyword{MHQoL,} \keyword{States,} File ‘mhqol_states_to_scores.Rd’: \keyword{MHQoL,} \keyword{Scores,} File ‘mhqol_utilities.Rd’: \keyword{MHQoL,} \keyword{Utilities,} File ‘mhqol_utilities_to_scores.Rd’: \keyword{MHQoL,} \keyword{States,} File ‘mhqol_utilities_to_states.Rd’: \keyword{MHQoL,} \keyword{States,} File ‘mhqol_valueset.Rd’: \keyword{MHQoL,} \keyword{Valueset,} * checking package namespace information ... OK * checking package dependencies ... OK * 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 ‘mhqol’ can be installed ... [1s/1s] OK * checking package directory ... OK * checking for future file timestamps ... OK * checking DESCRIPTION meta-information ... NOTE Malformed Description field: should contain one or more complete sentences. * checking top-level files ... NOTE Non-standard file/directory found at top level: ‘utils.R’ * 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 ... [0s/0s] OK * checking whether the package can be loaded with stated dependencies ... [0s/0s] OK * checking whether the package can be unloaded cleanly ... [0s/0s] OK * checking whether the namespace can be loaded with stated dependencies ... [0s/0s] OK * checking whether the namespace can be unloaded cleanly ... [0s/0s] OK * checking loading without being on the library search path ... [0s/0s] OK * checking use of S3 registration ... 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 ... [3s/3s] NOTE mhqol_LSS: no visible global function definition for ‘where’ mhqol_scores_to_states: no visible binding for global variable ‘SI’ mhqol_scores_to_states: no visible binding for global variable ‘na.rm’ mhqol_scores_to_states: no visible binding for global variable ‘IN’ mhqol_scores_to_states: no visible binding for global variable ‘MO’ mhqol_scores_to_states: no visible binding for global variable ‘RE’ mhqol_scores_to_states: no visible binding for global variable ‘DA’ mhqol_scores_to_states: no visible binding for global variable ‘PH’ mhqol_scores_to_states: no visible binding for global variable ‘FU’ mhqol_utilities: no visible binding for global variable ‘SI’ mhqol_utilities: no visible binding for global variable ‘IN’ mhqol_utilities: no visible binding for global variable ‘MO’ mhqol_utilities: no visible binding for global variable ‘RE’ mhqol_utilities: no visible binding for global variable ‘DA’ mhqol_utilities: no visible binding for global variable ‘PH’ mhqol_utilities: no visible binding for global variable ‘FU’ mhqol_valueset: no visible binding for global variable ‘dimensions’ Undefined global functions or variables: DA FU IN MO PH RE SI dimensions na.rm where * checking Rd files ... [0s/0s] OK * checking Rd metadata ... WARNING Rd files with duplicated alias 'mhqol_utilities': ‘mhqol.Rd’ ‘mhqol_utilities.Rd’ * checking Rd line widths ... NOTE Rd file 'mhqol.Rd': \usage lines wider than 90 characters: mhqol_utilities(dimensions, country = "Netherlands", ignore_invalid = FALSE, ignore_NA = TRUE, retain_old_variables = TRUE) Rd file 'mhqol_LSS.Rd': \usage lines wider than 90 characters: mhqol_LSS(dimensions, metric = c("average", "total"), ignore_invalid = FALSE, ignore_NA = TRUE Rd file 'mhqol_scores_to_states.Rd': \usage lines wider than 90 characters: mhqol_scores_to_states(scores, ignore_invalid = FALSE, ignore_NA = FALSE, retain_old_variables = TRUE) Rd file 'mhqol_states_to_scores.Rd': \usage lines wider than 90 characters: mhqol_states_to_scores(states, ignore_invalid = FALSE, ignore_NA = FALSE, retain_old_variables = TRUE) Rd file 'mhqol_utilities.Rd': \usage lines wider than 90 characters: mhqol_utilities(dimensions, country = "Netherlands", ignore_invalid = FALSE, ignore_NA = TRUE, retain_old_variables = TRUE) Rd file 'mhqol_utilities_to_scores.Rd': \usage lines wider than 90 characters: mhqol_utilities_to_scores(utilities, country = "Netherlands", ignore_invalid = FALSE, ignore_NA = TRUE, retain_old_variables = TRUE) Rd file 'mhqol_utilities_to_states.Rd': \usage lines wider than 90 characters: mhqol_utilities_to_states(utilities, ignore_invalid = FALSE, ignore_NA = FALSE, retain_old_variables = TRUE) These lines will be truncated in the PDF manual. * checking Rd cross-references ... OK * checking for missing documentation entries ... WARNING Undocumented code objects: ‘df_utilities_countries’ Undocumented data sets: ‘df_utilities_countries’ All user-level objects in a package should have documentation entries. See chapter ‘Writing R documentation files’ in the ‘Writing R Extensions’ manual. * checking for code/documentation mismatches ... WARNING Codoc mismatches from Rd file 'mhqol_utilities_to_states.Rd': mhqol_utilities_to_states Code: function(utilities, country = "Netherlands", ignore_invalid = FALSE, ignore_NA = FALSE, retain_old_variables = TRUE) Docs: function(utilities, ignore_invalid = FALSE, ignore_NA = FALSE, retain_old_variables = TRUE) Argument names in code not in docs: country Mismatches in argument names: Position: 2 Code: country Docs: ignore_invalid Position: 3 Code: ignore_invalid Docs: ignore_NA Position: 4 Code: ignore_NA Docs: retain_old_variables * checking Rd \usage sections ... WARNING Undocumented arguments in Rd file 'mhqol.Rd' ‘retain_old_variables’ Documented arguments not in \usage in Rd file 'mhqol.Rd': ‘metric’ Documented arguments not in \usage in Rd file 'mhqol_utilities_to_states.Rd': ‘country’ Bad \usage lines found in Rd file 'mhqol_LSS.Rd': mhqol_LSS(dimensions, metric = c("average", "total"), ignore_invalid = FALSE, ignore_NA = TRUE Functions with \usage entries need to have the appropriate \alias entries, and all their arguments documented. The \usage entries must correspond to syntactically valid R code. See chapter ‘Writing R documentation files’ in the ‘Writing R Extensions’ manual. * checking Rd contents ... OK * checking for unstated dependencies in examples ... ERROR Warning: parse error in file 'lines': 5: unexpected symbol 143: 144: Get the ^ ** will not attempt to run examples * checking contents of ‘data’ directory ... OK * checking data for non-ASCII characters ... [0s/0s] OK * checking LazyData ... OK * checking data for ASCII and uncompressed saves ... OK * checking examples ... SKIPPED * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... [2s/2s] ERROR Running ‘testthat.R’ [2s/2s] Running the tests in ‘tests/testthat.R’ failed. Complete output: > # This file is part of the standard setup for testthat. > # It is recommended that you do not modify it. > # > # Where should you do additional test configuration? > # Learn more about the roles of various files in: > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview > # * https://testthat.r-lib.org/articles/special-files.html > > library(testthat) > library(mhqol) > > test_check("mhqol") [ FAIL 5 | WARN 14 | SKIP 0 | PASS 86 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-mhqol_scores_to_states.R:21:3'): Test whether when ignore_na = TRUE, the function returns a warning when there are NA values in the data ── Error in `dplyr::mutate(scores, SI_s = if ("SI" %in% colnames(scores)) { if (any(SI < 0 | SI > 3, na.rm == TRUE)) stop("Error: SI contains values outside [0,3]") dplyr::case_when(SI == 3 ~ "I think very positively about myself", SI == 2 ~ "I think positively about myself", SI == 1 ~ "I think negatively about myself", SI == 0 ~ "I think very negatively about myself", TRUE ~ NA_character_) } else { NA_character_ }, IN_s = if ("IN" %in% colnames(scores)) { if (any(IN < 0 | IN > 3, na.rm = TRUE)) stop("Error: IN contains values outside [0,3]") dplyr::case_when(IN == 3 ~ "I am very satisfied with my level of independence", IN == 2 ~ "I am satisfied with my level of independence", IN == 1 ~ "I am dissatisfied with my level of independence", IN == 0 ~ "I am very dissatisfied with my level of independence", TRUE ~ NA_character_) } else { NA_character_ }, MO_s = if ("MO" %in% colnames(scores)) { if (any(MO < 0 | MO > 3, na.rm = TRUE)) stop("Error: MO contains values outside [0,3]") dplyr::case_when(MO == 3 ~ "I do not feel anxious, gloomy, or depressed", MO == 2 ~ "I feel a little anxious, gloomy, or depressed", MO == 1 ~ "I feel anxious, gloomy, or depressed", MO == 0 ~ "I feel very anxious, gloomy, or depressed", TRUE ~ NA_character_) } else { NA_character_ }, RE_s = if ("RE" %in% colnames(scores)) { if (any(RE < 0 | RE > 3, na.rm = TRUE)) stop("Error: RE contains values outside [0,3]") dplyr::case_when(RE == 3 ~ "I am very satisfied with my relationships", RE == 2 ~ "I am satisfied with my relationships", RE == 1 ~ "I am dissatisfied with my relationships", RE == 0 ~ "I am very dissatisfied with my relationships", TRUE ~ NA_character_) } else { NA_character_ }, DA_s = if ("DA" %in% colnames(scores)) { if (any(DA < 0 | DA > 3, na.rm = TRUE)) stop("Error: DA contains values outside [0,3]") dplyr::case_when(DA == 3 ~ "I am very satisfied with my daily activities", DA == 2 ~ "I am satisfied with my daily activities", DA == 1 ~ "I am dissatisfied with my daily activities", DA == 0 ~ "I am very dissatisfied with my daily activities", TRUE ~ NA_character_) } else { NA_character_ }, PH_s = if ("PH" %in% colnames(scores)) { if (any(PH < 0 | PH > 3, na.rm = TRUE)) stop("Error: PH contains values outside [0,3]") dplyr::case_when(PH == 3 ~ "I have no physical health problems", PH == 2 ~ "I have some physical health problems", PH == 1 ~ "I have many physical health problems", PH == 0 ~ "I have a great many physical health problems", TRUE ~ NA_character_) } else { NA_character_ }, FU_s = if ("FU" %in% colnames(scores)) { if (any(FU < 0 | FU > 3, na.rm = TRUE)) stop("Error: FU contains values outside [0,3]") dplyr::case_when(FU == 3 ~ "I am very optimistic about my future", FU == 2 ~ "I am optimistic about my future", FU == 1 ~ "I am gloomy about my future", FU == 0 ~ "I am very gloomy about my future", TRUE ~ NA_character_) } else { NA_character_ })`: i In argument: `SI_s = if (...) NULL`. Caused by error: ! object 'na.rm' not found Backtrace: ▆ 1. ├─testthat::expect_warning(...) at test-mhqol_scores_to_states.R:21:3 2. │ └─testthat:::expect_condition_matching(...) 3. │ └─testthat:::quasi_capture(...) 4. │ ├─testthat (local) .capture(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo)) 7. ├─mhqol::mhqol_scores_to_states(...) 8. │ ├─dplyr::mutate(...) 9. │ └─dplyr:::mutate.data.frame(...) 10. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by) 11. │ ├─base::withCallingHandlers(...) 12. │ └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns) 13. │ └─mask$eval_all_mutate(quo) 14. │ └─dplyr (local) eval() 15. └─base::.handleSimpleError(...) 16. └─dplyr (local) h(simpleError(msg, call)) 17. └─rlang::abort(message, class = error_class, parent = parent, call = error_call) ── Error ('test-mhqol_scores_to_states.R:45:3'): Test whether when ignore_invalid = TRUE, he function does not return an Error but a Warning when there are missing cols in the data ── Error in `dplyr::mutate(scores, SI_s = if ("SI" %in% colnames(scores)) { if (any(SI < 0 | SI > 3, na.rm == TRUE)) stop("Error: SI contains values outside [0,3]") dplyr::case_when(SI == 3 ~ "I think very positively about myself", SI == 2 ~ "I think positively about myself", SI == 1 ~ "I think negatively about myself", SI == 0 ~ "I think very negatively about myself", TRUE ~ NA_character_) } else { NA_character_ }, IN_s = if ("IN" %in% colnames(scores)) { if (any(IN < 0 | IN > 3, na.rm = TRUE)) stop("Error: IN contains values outside [0,3]") dplyr::case_when(IN == 3 ~ "I am very satisfied with my level of independence", IN == 2 ~ "I am satisfied with my level of independence", IN == 1 ~ "I am dissatisfied with my level of independence", IN == 0 ~ "I am very dissatisfied with my level of independence", TRUE ~ NA_character_) } else { NA_character_ }, MO_s = if ("MO" %in% colnames(scores)) { if (any(MO < 0 | MO > 3, na.rm = TRUE)) stop("Error: MO contains values outside [0,3]") dplyr::case_when(MO == 3 ~ "I do not feel anxious, gloomy, or depressed", MO == 2 ~ "I feel a little anxious, gloomy, or depressed", MO == 1 ~ "I feel anxious, gloomy, or depressed", MO == 0 ~ "I feel very anxious, gloomy, or depressed", TRUE ~ NA_character_) } else { NA_character_ }, RE_s = if ("RE" %in% colnames(scores)) { if (any(RE < 0 | RE > 3, na.rm = TRUE)) stop("Error: RE contains values outside [0,3]") dplyr::case_when(RE == 3 ~ "I am very satisfied with my relationships", RE == 2 ~ "I am satisfied with my relationships", RE == 1 ~ "I am dissatisfied with my relationships", RE == 0 ~ "I am very dissatisfied with my relationships", TRUE ~ NA_character_) } else { NA_character_ }, DA_s = if ("DA" %in% colnames(scores)) { if (any(DA < 0 | DA > 3, na.rm = TRUE)) stop("Error: DA contains values outside [0,3]") dplyr::case_when(DA == 3 ~ "I am very satisfied with my daily activities", DA == 2 ~ "I am satisfied with my daily activities", DA == 1 ~ "I am dissatisfied with my daily activities", DA == 0 ~ "I am very dissatisfied with my daily activities", TRUE ~ NA_character_) } else { NA_character_ }, PH_s = if ("PH" %in% colnames(scores)) { if (any(PH < 0 | PH > 3, na.rm = TRUE)) stop("Error: PH contains values outside [0,3]") dplyr::case_when(PH == 3 ~ "I have no physical health problems", PH == 2 ~ "I have some physical health problems", PH == 1 ~ "I have many physical health problems", PH == 0 ~ "I have a great many physical health problems", TRUE ~ NA_character_) } else { NA_character_ }, FU_s = if ("FU" %in% colnames(scores)) { if (any(FU < 0 | FU > 3, na.rm = TRUE)) stop("Error: FU contains values outside [0,3]") dplyr::case_when(FU == 3 ~ "I am very optimistic about my future", FU == 2 ~ "I am optimistic about my future", FU == 1 ~ "I am gloomy about my future", FU == 0 ~ "I am very gloomy about my future", TRUE ~ NA_character_) } else { NA_character_ })`: i In argument: `SI_s = if (...) NULL`. Caused by error: ! object 'na.rm' not found Backtrace: ▆ 1. ├─testthat::expect_warning(...) at test-mhqol_scores_to_states.R:45:3 2. │ └─testthat:::expect_condition_matching(...) 3. │ └─testthat:::quasi_capture(...) 4. │ ├─testthat (local) .capture(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo)) 7. ├─mhqol::mhqol_scores_to_states(...) 8. │ ├─dplyr::mutate(...) 9. │ └─dplyr:::mutate.data.frame(...) 10. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by) 11. │ ├─base::withCallingHandlers(...) 12. │ └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns) 13. │ └─mask$eval_all_mutate(quo) 14. │ └─dplyr (local) eval() 15. └─base::.handleSimpleError(...) 16. └─dplyr (local) h(simpleError(msg, call)) 17. └─rlang::abort(message, class = error_class, parent = parent, call = error_call) ── Error ('test-mhqol_scores_to_states.R:56:3'): Test whether when retain_old_variables = TRUE, the function also returns the original variables in the data ── Error in `dplyr::mutate(scores, SI_s = if ("SI" %in% colnames(scores)) { if (any(SI < 0 | SI > 3, na.rm == TRUE)) stop("Error: SI contains values outside [0,3]") dplyr::case_when(SI == 3 ~ "I think very positively about myself", SI == 2 ~ "I think positively about myself", SI == 1 ~ "I think negatively about myself", SI == 0 ~ "I think very negatively about myself", TRUE ~ NA_character_) } else { NA_character_ }, IN_s = if ("IN" %in% colnames(scores)) { if (any(IN < 0 | IN > 3, na.rm = TRUE)) stop("Error: IN contains values outside [0,3]") dplyr::case_when(IN == 3 ~ "I am very satisfied with my level of independence", IN == 2 ~ "I am satisfied with my level of independence", IN == 1 ~ "I am dissatisfied with my level of independence", IN == 0 ~ "I am very dissatisfied with my level of independence", TRUE ~ NA_character_) } else { NA_character_ }, MO_s = if ("MO" %in% colnames(scores)) { if (any(MO < 0 | MO > 3, na.rm = TRUE)) stop("Error: MO contains values outside [0,3]") dplyr::case_when(MO == 3 ~ "I do not feel anxious, gloomy, or depressed", MO == 2 ~ "I feel a little anxious, gloomy, or depressed", MO == 1 ~ "I feel anxious, gloomy, or depressed", MO == 0 ~ "I feel very anxious, gloomy, or depressed", TRUE ~ NA_character_) } else { NA_character_ }, RE_s = if ("RE" %in% colnames(scores)) { if (any(RE < 0 | RE > 3, na.rm = TRUE)) stop("Error: RE contains values outside [0,3]") dplyr::case_when(RE == 3 ~ "I am very satisfied with my relationships", RE == 2 ~ "I am satisfied with my relationships", RE == 1 ~ "I am dissatisfied with my relationships", RE == 0 ~ "I am very dissatisfied with my relationships", TRUE ~ NA_character_) } else { NA_character_ }, DA_s = if ("DA" %in% colnames(scores)) { if (any(DA < 0 | DA > 3, na.rm = TRUE)) stop("Error: DA contains values outside [0,3]") dplyr::case_when(DA == 3 ~ "I am very satisfied with my daily activities", DA == 2 ~ "I am satisfied with my daily activities", DA == 1 ~ "I am dissatisfied with my daily activities", DA == 0 ~ "I am very dissatisfied with my daily activities", TRUE ~ NA_character_) } else { NA_character_ }, PH_s = if ("PH" %in% colnames(scores)) { if (any(PH < 0 | PH > 3, na.rm = TRUE)) stop("Error: PH contains values outside [0,3]") dplyr::case_when(PH == 3 ~ "I have no physical health problems", PH == 2 ~ "I have some physical health problems", PH == 1 ~ "I have many physical health problems", PH == 0 ~ "I have a great many physical health problems", TRUE ~ NA_character_) } else { NA_character_ }, FU_s = if ("FU" %in% colnames(scores)) { if (any(FU < 0 | FU > 3, na.rm = TRUE)) stop("Error: FU contains values outside [0,3]") dplyr::case_when(FU == 3 ~ "I am very optimistic about my future", FU == 2 ~ "I am optimistic about my future", FU == 1 ~ "I am gloomy about my future", FU == 0 ~ "I am very gloomy about my future", TRUE ~ NA_character_) } else { NA_character_ })`: i In argument: `SI_s = if (...) NULL`. Caused by error: ! object 'na.rm' not found Backtrace: ▆ 1. ├─mhqol::mhqol_scores_to_states(...) at test-mhqol_scores_to_states.R:56:3 2. │ ├─dplyr::mutate(...) 3. │ └─dplyr:::mutate.data.frame(...) 4. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by) 5. │ ├─base::withCallingHandlers(...) 6. │ └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns) 7. │ └─mask$eval_all_mutate(quo) 8. │ └─dplyr (local) eval() 9. └─base::.handleSimpleError(...) 10. └─dplyr (local) h(simpleError(msg, call)) 11. └─rlang::abort(message, class = error_class, parent = parent, call = error_call) ── Error ('test-mhqol_scores_to_states.R:72:3'): Test whether when retain_old_variables = FALSE, the function does not return the original variables in the data ── Error in `dplyr::mutate(scores, SI_s = if ("SI" %in% colnames(scores)) { if (any(SI < 0 | SI > 3, na.rm == TRUE)) stop("Error: SI contains values outside [0,3]") dplyr::case_when(SI == 3 ~ "I think very positively about myself", SI == 2 ~ "I think positively about myself", SI == 1 ~ "I think negatively about myself", SI == 0 ~ "I think very negatively about myself", TRUE ~ NA_character_) } else { NA_character_ }, IN_s = if ("IN" %in% colnames(scores)) { if (any(IN < 0 | IN > 3, na.rm = TRUE)) stop("Error: IN contains values outside [0,3]") dplyr::case_when(IN == 3 ~ "I am very satisfied with my level of independence", IN == 2 ~ "I am satisfied with my level of independence", IN == 1 ~ "I am dissatisfied with my level of independence", IN == 0 ~ "I am very dissatisfied with my level of independence", TRUE ~ NA_character_) } else { NA_character_ }, MO_s = if ("MO" %in% colnames(scores)) { if (any(MO < 0 | MO > 3, na.rm = TRUE)) stop("Error: MO contains values outside [0,3]") dplyr::case_when(MO == 3 ~ "I do not feel anxious, gloomy, or depressed", MO == 2 ~ "I feel a little anxious, gloomy, or depressed", MO == 1 ~ "I feel anxious, gloomy, or depressed", MO == 0 ~ "I feel very anxious, gloomy, or depressed", TRUE ~ NA_character_) } else { NA_character_ }, RE_s = if ("RE" %in% colnames(scores)) { if (any(RE < 0 | RE > 3, na.rm = TRUE)) stop("Error: RE contains values outside [0,3]") dplyr::case_when(RE == 3 ~ "I am very satisfied with my relationships", RE == 2 ~ "I am satisfied with my relationships", RE == 1 ~ "I am dissatisfied with my relationships", RE == 0 ~ "I am very dissatisfied with my relationships", TRUE ~ NA_character_) } else { NA_character_ }, DA_s = if ("DA" %in% colnames(scores)) { if (any(DA < 0 | DA > 3, na.rm = TRUE)) stop("Error: DA contains values outside [0,3]") dplyr::case_when(DA == 3 ~ "I am very satisfied with my daily activities", DA == 2 ~ "I am satisfied with my daily activities", DA == 1 ~ "I am dissatisfied with my daily activities", DA == 0 ~ "I am very dissatisfied with my daily activities", TRUE ~ NA_character_) } else { NA_character_ }, PH_s = if ("PH" %in% colnames(scores)) { if (any(PH < 0 | PH > 3, na.rm = TRUE)) stop("Error: PH contains values outside [0,3]") dplyr::case_when(PH == 3 ~ "I have no physical health problems", PH == 2 ~ "I have some physical health problems", PH == 1 ~ "I have many physical health problems", PH == 0 ~ "I have a great many physical health problems", TRUE ~ NA_character_) } else { NA_character_ }, FU_s = if ("FU" %in% colnames(scores)) { if (any(FU < 0 | FU > 3, na.rm = TRUE)) stop("Error: FU contains values outside [0,3]") dplyr::case_when(FU == 3 ~ "I am very optimistic about my future", FU == 2 ~ "I am optimistic about my future", FU == 1 ~ "I am gloomy about my future", FU == 0 ~ "I am very gloomy about my future", TRUE ~ NA_character_) } else { NA_character_ })`: i In argument: `SI_s = if (...) NULL`. Caused by error: ! object 'na.rm' not found Backtrace: ▆ 1. ├─mhqol::mhqol_scores_to_states(...) at test-mhqol_scores_to_states.R:72:3 2. │ ├─dplyr::mutate(...) 3. │ └─dplyr:::mutate.data.frame(...) 4. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by) 5. │ ├─base::withCallingHandlers(...) 6. │ └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns) 7. │ └─mask$eval_all_mutate(quo) 8. │ └─dplyr (local) eval() 9. └─base::.handleSimpleError(...) 10. └─dplyr (local) h(simpleError(msg, call)) 11. └─rlang::abort(message, class = error_class, parent = parent, call = error_call) ── Error ('test-mhqol_scores_to_states.R:87:3'): Test whether the function returns the correct states for the scores ── Error in `dplyr::mutate(scores, SI_s = if ("SI" %in% colnames(scores)) { if (any(SI < 0 | SI > 3, na.rm == TRUE)) stop("Error: SI contains values outside [0,3]") dplyr::case_when(SI == 3 ~ "I think very positively about myself", SI == 2 ~ "I think positively about myself", SI == 1 ~ "I think negatively about myself", SI == 0 ~ "I think very negatively about myself", TRUE ~ NA_character_) } else { NA_character_ }, IN_s = if ("IN" %in% colnames(scores)) { if (any(IN < 0 | IN > 3, na.rm = TRUE)) stop("Error: IN contains values outside [0,3]") dplyr::case_when(IN == 3 ~ "I am very satisfied with my level of independence", IN == 2 ~ "I am satisfied with my level of independence", IN == 1 ~ "I am dissatisfied with my level of independence", IN == 0 ~ "I am very dissatisfied with my level of independence", TRUE ~ NA_character_) } else { NA_character_ }, MO_s = if ("MO" %in% colnames(scores)) { if (any(MO < 0 | MO > 3, na.rm = TRUE)) stop("Error: MO contains values outside [0,3]") dplyr::case_when(MO == 3 ~ "I do not feel anxious, gloomy, or depressed", MO == 2 ~ "I feel a little anxious, gloomy, or depressed", MO == 1 ~ "I feel anxious, gloomy, or depressed", MO == 0 ~ "I feel very anxious, gloomy, or depressed", TRUE ~ NA_character_) } else { NA_character_ }, RE_s = if ("RE" %in% colnames(scores)) { if (any(RE < 0 | RE > 3, na.rm = TRUE)) stop("Error: RE contains values outside [0,3]") dplyr::case_when(RE == 3 ~ "I am very satisfied with my relationships", RE == 2 ~ "I am satisfied with my relationships", RE == 1 ~ "I am dissatisfied with my relationships", RE == 0 ~ "I am very dissatisfied with my relationships", TRUE ~ NA_character_) } else { NA_character_ }, DA_s = if ("DA" %in% colnames(scores)) { if (any(DA < 0 | DA > 3, na.rm = TRUE)) stop("Error: DA contains values outside [0,3]") dplyr::case_when(DA == 3 ~ "I am very satisfied with my daily activities", DA == 2 ~ "I am satisfied with my daily activities", DA == 1 ~ "I am dissatisfied with my daily activities", DA == 0 ~ "I am very dissatisfied with my daily activities", TRUE ~ NA_character_) } else { NA_character_ }, PH_s = if ("PH" %in% colnames(scores)) { if (any(PH < 0 | PH > 3, na.rm = TRUE)) stop("Error: PH contains values outside [0,3]") dplyr::case_when(PH == 3 ~ "I have no physical health problems", PH == 2 ~ "I have some physical health problems", PH == 1 ~ "I have many physical health problems", PH == 0 ~ "I have a great many physical health problems", TRUE ~ NA_character_) } else { NA_character_ }, FU_s = if ("FU" %in% colnames(scores)) { if (any(FU < 0 | FU > 3, na.rm = TRUE)) stop("Error: FU contains values outside [0,3]") dplyr::case_when(FU == 3 ~ "I am very optimistic about my future", FU == 2 ~ "I am optimistic about my future", FU == 1 ~ "I am gloomy about my future", FU == 0 ~ "I am very gloomy about my future", TRUE ~ NA_character_) } else { NA_character_ })`: i In argument: `SI_s = if (...) NULL`. Caused by error: ! object 'na.rm' not found Backtrace: ▆ 1. ├─mhqol::mhqol_scores_to_states(...) at test-mhqol_scores_to_states.R:87:3 2. │ ├─dplyr::mutate(...) 3. │ └─dplyr:::mutate.data.frame(...) 4. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by) 5. │ ├─base::withCallingHandlers(...) 6. │ └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns) 7. │ └─mask$eval_all_mutate(quo) 8. │ └─dplyr (local) eval() 9. └─base::.handleSimpleError(...) 10. └─dplyr (local) h(simpleError(msg, call)) 11. └─rlang::abort(message, class = error_class, parent = parent, call = error_call) [ FAIL 5 | WARN 14 | SKIP 0 | PASS 86 ] Error: Test failures Execution halted * checking PDF version of manual ... [2s/2s] OK * checking HTML version of manual ... [0s/0s] OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * DONE Status: 2 ERRORs, 4 WARNINGs, 5 NOTEs