mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2026-06-19 05:07:30 +02:00
additional redcap_wider function
This commit is contained in:
parent
edafc35806
commit
873ed7f581
6 changed files with 87 additions and 3 deletions
10
tests/testthat/test-redcap_wider.R
Normal file
10
tests/testthat/test-redcap_wider.R
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
test_that("redcap_wider() returns expected output", {
|
||||
list <- list(data.frame(record_id = c(1,2,1,2), redcap_event_name = c("baseline", "baseline", "followup", "followup"), age = c(25,26,27,28)),
|
||||
data.frame(record_id = c(1,2), redcap_event_name = c("baseline", "baseline"), gender = c("male", "female")))
|
||||
|
||||
expect_equal(redcap_wider(list),
|
||||
data.frame(record_id = c(1,2),
|
||||
age_baseline_long = c(25,26),
|
||||
age_followup_long = c(27,28),
|
||||
gender = c("male","female")))
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue