mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2026-06-19 13:17:30 +02:00
quick and working sollution to get variable suffixes in the tables. included in the easy_redcap() when widening
This commit is contained in:
parent
4ac9282c8f
commit
c52fd2947c
7 changed files with 102 additions and 26 deletions
|
|
@ -1,16 +1,16 @@
|
|||
library(testthat)
|
||||
# library(testthat)
|
||||
test_that("redcap_wider() returns expected output", {
|
||||
list <-
|
||||
list(
|
||||
data.frame(
|
||||
dplyr::tibble(
|
||||
record_id = c(1, 2, 1, 2),
|
||||
redcap_event_name = c("baseline", "baseline", "followup", "followup"),
|
||||
age = c(25, 26, 27, 28)
|
||||
),
|
||||
data.frame(
|
||||
dplyr::tibble(
|
||||
record_id = c(1, 2),
|
||||
redcap_event_name = c("baseline", "baseline"),
|
||||
gender = c("male", "female")
|
||||
sex = c("male", "female")
|
||||
)
|
||||
)
|
||||
|
||||
|
|
@ -18,9 +18,9 @@ test_that("redcap_wider() returns expected output", {
|
|||
redcap_wider(list),
|
||||
dplyr::tibble(
|
||||
record_id = c(1, 2),
|
||||
age_baseline = c(25, 26),
|
||||
age_followup = c(27, 28),
|
||||
gender = c("male", "female")
|
||||
age____baseline = c(25, 26),
|
||||
age____followup = c(27, 28),
|
||||
sex = c("male", "female")
|
||||
)
|
||||
)
|
||||
})
|
||||
|
|
@ -29,6 +29,7 @@ test_that("redcap_wider() returns expected output", {
|
|||
# Using test data
|
||||
|
||||
# Set up the path and data -------------------------------------------------
|
||||
|
||||
file_paths <- lapply(
|
||||
c(records = "WARRIORtestForSoftwa_DATA_2018-06-21_1431.csv",
|
||||
metadata = "WARRIORtestForSoftwareUpgrades_DataDictionary_2018-06-21.csv"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue