From 576f39153256af27039a44afd2d7388b11d65167 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Tue, 19 Nov 2024 14:00:34 +0000 Subject: [PATCH] fix checks --- DESCRIPTION | 2 ++ R/load_survey.R | 2 +- tests/testthat/test-as_contact_survey.r | 2 +- tests/testthat/test-checks.r | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3b9709f..c78786d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -30,6 +30,7 @@ Imports: lifecycle, lubridate, memoise, + purrr, oai, wpp2017, xml2 @@ -38,6 +39,7 @@ Suggests: here, knitr, purrr, + quarto, reshape2, rmarkdown, roxyglobals (>= 1.0.0), diff --git a/R/load_survey.R b/R/load_survey.R index 0ece48b..6a90261 100644 --- a/R/load_survey.R +++ b/R/load_survey.R @@ -151,7 +151,7 @@ load_survey <- function(files, ...) { participants = main_surveys[["participant"]], contacts = main_surveys[["contact"]], reference = reference - ), + ) ) if (!is.null(new_survey$reference)) { diff --git a/tests/testthat/test-as_contact_survey.r b/tests/testthat/test-as_contact_survey.r index 138bf92..cdbcbb9 100644 --- a/tests/testthat/test-as_contact_survey.r +++ b/tests/testthat/test-as_contact_survey.r @@ -23,6 +23,6 @@ erroneous_structure1$participants$part_id <- NULL test_that("incorrect structure of data frames is correctly identified", { expect_error( as_contact_survey(erroneous_structure1), - "Names must include the elements \\{'part_id'\\}" + "Names must include the elements \\{'part_id'\\}" ## nolint: nonportable_path_linter ) }) diff --git a/tests/testthat/test-checks.r b/tests/testthat/test-checks.r index b74138a..e39417d 100644 --- a/tests/testthat/test-checks.r +++ b/tests/testthat/test-checks.r @@ -1,6 +1,6 @@ library(data.table) -erroneous_survey <- new_contact_survey(polymod$participants, polymod$contacts, polymod$reference) +erroneous_survey <- as_contact_survey(polymod) erroneous_type1 <- copy(erroneous_survey) erroneous_type1$participants <- "test"