Skip to content

Commit

Permalink
read oneshot eav
Browse files Browse the repository at this point in the history
ref #308
  • Loading branch information
wibeasley committed Sep 27, 2020
1 parent 76b23d9 commit 8605915
Show file tree
Hide file tree
Showing 9 changed files with 220 additions and 219 deletions.
25 changes: 25 additions & 0 deletions inst/test-data/specific-redcapr/read-oneshot-eav/default.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
structure(list(record_id = 1:5, name_first = c("Nutmeg", "Tumtum",
"Marcus", "Trudy", "John Lee"), name_last = c("Nutmouse", "Nutmouse",
"Wood", "DAG", "Walker"), address = c("14 Rose Cottage St.\nKenning UK, 323232",
"14 Rose Cottage Blvd.\nKenning UK 34243", "243 Hill St.\nGuthrie OK 73402",
"342 Elm\nDuncanville TX, 75116", "Hotel Suite\nNew Orleans LA, 70115"
), telephone = c("(405) 321-1111", "(405) 321-2222", "(405) 321-3333",
"(405) 321-4444", "(405) 321-5555"), email = c("[email protected]",
"[email protected]", "[email protected]", "[email protected]", "[email protected]"
), dob = c("2003-08-30", "2003-03-10", "1934-04-09", "1952-11-02",
"1955-04-15"), age = c(11L, 11L, 80L, 61L, 59L), sex = c(0L,
1L, 1L, 0L, 1L), height = c(7, 6, 180, 165, 193.04), weight = c(1L,
1L, 80L, 54L, 104L), bmi = c(204.1, 277.8, 24.7, 19.8, 27.9),
comments = c("Character in a book, with some guessing", "A mouse character from a good book",
"completely made up", "This record doesn't have a DAG assigned\n\nSo call up Trudy on the telephone\nSend her a letter in the mail",
"Had a hand for trouble and a eye for cash\n\nHe had a gold watch chain and a black mustache"
), mugshot = c(197977L, 197978L, 197979L, 198002L, 198021L
), race___1 = c(FALSE, FALSE, FALSE, FALSE, TRUE), race___2 = c(FALSE,
FALSE, FALSE, TRUE, FALSE), race___3 = c(FALSE, TRUE, FALSE,
FALSE, FALSE), race___4 = c(FALSE, FALSE, TRUE, FALSE, FALSE
), race___5 = c(TRUE, TRUE, TRUE, TRUE, FALSE), race___6 = c(FALSE,
FALSE, FALSE, FALSE, TRUE), ethnicity = c(1L, 1L, 0L, 1L,
2L), interpreter_needed = c(0L, 0L, 1L, NA, 0L), demographics_complete = c(2L,
2L, 2L, 2L, 2L), health_complete = c(1L, 0L, 2L, 2L, 0L),
race_and_ethnicity_complete = c(2L, 0L, 2L, 2L, 2L)), row.names = c(NA,
-5L), class = c("tbl_df", "tbl", "data.frame"))
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
structure(list(record_id = 5L, name_first = "John Lee", name_last = "Walker",
address = "Hotel Suite\nNew Orleans LA, 70115", telephone = "(405) 321-5555",
email = "[email protected]", dob = "1955-04-15", age = 59L,
sex = 1L, height = 193.04, weight = 104L, bmi = 27.9, comments = "Had a hand for trouble and a eye for cash\n\nHe had a gold watch chain and a black mustache",
mugshot = 198021L, race___1 = TRUE, race___2 = FALSE, race___3 = FALSE,
race___4 = FALSE, race___5 = FALSE, race___6 = TRUE, ethnicity = 2L,
interpreter_needed = 0L, demographics_complete = 2L, health_complete = 0L,
race_and_ethnicity_complete = 2L), row.names = c(NA, -1L), class = c("tbl_df",
"tbl", "data.frame"))
14 changes: 14 additions & 0 deletions inst/test-data/specific-redcapr/read-oneshot-eav/filter-numeric.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
structure(list(record_id = 3:4, name_first = c("Marcus", "Trudy"
), name_last = c("Wood", "DAG"), address = c("243 Hill St.\nGuthrie OK 73402",
"342 Elm\nDuncanville TX, 75116"), telephone = c("(405) 321-3333",
"(405) 321-4444"), email = c("[email protected]", "[email protected]"
), dob = c("1934-04-09", "1952-11-02"), age = c(80L, 61L), sex = 1:0,
height = c(180L, 165L), weight = c(80L, 54L), bmi = c(24.7,
19.8), comments = c("completely made up", "This record doesn't have a DAG assigned\n\nSo call up Trudy on the telephone\nSend her a letter in the mail"
), mugshot = c(197979L, 198002L), race___1 = c(FALSE, FALSE
), race___2 = c(FALSE, TRUE), race___3 = c(FALSE, FALSE),
race___4 = c(TRUE, FALSE), race___5 = c(TRUE, TRUE), race___6 = c(FALSE,
FALSE), ethnicity = 0:1, interpreter_needed = c(1L, NA),
demographics_complete = c(2L, 2L), health_complete = c(2L,
2L), race_and_ethnicity_complete = c(2L, 2L)), row.names = c(NA,
-2L), class = c("tbl_df", "tbl", "data.frame"))
28 changes: 28 additions & 0 deletions inst/test-data/specific-redcapr/read-oneshot-eav/label-and-dag.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
structure(list(record_id = 1:5, name_first = c("Nutmeg", "Tumtum",
"Marcus", "Trudy", "John Lee"), name_last = c("Nutmouse", "Nutmouse",
"Wood", "DAG", "Walker"), address = c("14 Rose Cottage St.\nKenning UK, 323232",
"14 Rose Cottage Blvd.\nKenning UK 34243", "243 Hill St.\nGuthrie OK 73402",
"342 Elm\nDuncanville TX, 75116", "Hotel Suite\nNew Orleans LA, 70115"
), telephone = c("(405) 321-1111", "(405) 321-2222", "(405) 321-3333",
"(405) 321-4444", "(405) 321-5555"), email = c("[email protected]",
"[email protected]", "[email protected]", "[email protected]", "[email protected]"
), dob = c("2003-08-30", "2003-03-10", "1934-04-09", "1952-11-02",
"1955-04-15"), age = c(11L, 11L, 80L, 61L, 59L), sex = c("Female",
"Male", "Male", "Female", "Male"), height = c(7, 6, 180, 165,
193.04), weight = c(1L, 1L, 80L, 54L, 104L), bmi = c(204.1, 277.8,
24.7, 19.8, 27.9), comments = c("Character in a book, with some guessing",
"A mouse character from a good book", "completely made up", "This record doesn't have a DAG assigned\n\nSo call up Trudy on the telephone\nSend her a letter in the mail",
"Had a hand for trouble and a eye for cash\n\nHe had a gold watch chain and a black mustache"
), mugshot = c(197977L, 197978L, 197979L, 198002L, 198021L),
race___1 = c(FALSE, FALSE, FALSE, FALSE, FALSE), race___2 = c(FALSE,
FALSE, FALSE, FALSE, FALSE), race___3 = c(FALSE, FALSE, FALSE,
FALSE, FALSE), race___4 = c(FALSE, FALSE, FALSE, FALSE, FALSE
), race___5 = c(FALSE, FALSE, FALSE, FALSE, FALSE), race___6 = c(FALSE,
FALSE, FALSE, FALSE, FALSE), ethnicity = c("NOT Hispanic or Latino",
"NOT Hispanic or Latino", "Unknown / Not Reported", "NOT Hispanic or Latino",
"Hispanic or Latino"), interpreter_needed = c("False", "False",
"True", NA, "False"), demographics_complete = c("Complete",
"Complete", "Complete", "Complete", "Complete"), health_complete = c("Unverified",
"Incomplete", "Complete", "Complete", "Incomplete"), race_and_ethnicity_complete = c("Complete",
"Incomplete", "Complete", "Complete", "Complete")), row.names = c(NA,
-5L), class = c("tbl_df", "tbl", "data.frame"))
25 changes: 25 additions & 0 deletions inst/test-data/specific-redcapr/read-oneshot-eav/label-header.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
structure(list(record_id = 1:5, name_first = c("Nutmeg", "Tumtum",
"Marcus", "Trudy", "John Lee"), name_last = c("Nutmouse", "Nutmouse",
"Wood", "DAG", "Walker"), address = c("14 Rose Cottage St.\nKenning UK, 323232",
"14 Rose Cottage Blvd.\nKenning UK 34243", "243 Hill St.\nGuthrie OK 73402",
"342 Elm\nDuncanville TX, 75116", "Hotel Suite\nNew Orleans LA, 70115"
), telephone = c("(405) 321-1111", "(405) 321-2222", "(405) 321-3333",
"(405) 321-4444", "(405) 321-5555"), email = c("[email protected]",
"[email protected]", "[email protected]", "[email protected]", "[email protected]"
), dob = c("2003-08-30", "2003-03-10", "1934-04-09", "1952-11-02",
"1955-04-15"), age = c(11L, 11L, 80L, 61L, 59L), sex = c(0L,
1L, 1L, 0L, 1L), height = c(7, 6, 180, 165, 193.04), weight = c(1L,
1L, 80L, 54L, 104L), bmi = c(204.1, 277.8, 24.7, 19.8, 27.9),
comments = c("Character in a book, with some guessing", "A mouse character from a good book",
"completely made up", "This record doesn't have a DAG assigned\n\nSo call up Trudy on the telephone\nSend her a letter in the mail",
"Had a hand for trouble and a eye for cash\n\nHe had a gold watch chain and a black mustache"
), mugshot = c(197977L, 197978L, 197979L, 198002L, 198021L
), race___1 = c(FALSE, FALSE, FALSE, FALSE, TRUE), race___2 = c(FALSE,
FALSE, FALSE, TRUE, FALSE), race___3 = c(FALSE, TRUE, FALSE,
FALSE, FALSE), race___4 = c(FALSE, FALSE, TRUE, FALSE, FALSE
), race___5 = c(TRUE, TRUE, TRUE, TRUE, FALSE), race___6 = c(FALSE,
FALSE, FALSE, FALSE, TRUE), ethnicity = c(1L, 1L, 0L, 1L,
2L), interpreter_needed = c(0L, 0L, 1L, NA, 0L), demographics_complete = c(2L,
2L, 2L, 2L, 2L), health_complete = c(1L, 0L, 2L, 2L, 0L),
race_and_ethnicity_complete = c(2L, 0L, 2L, 2L, 2L)), row.names = c(NA,
-5L), class = c("tbl_df", "tbl", "data.frame"))
25 changes: 25 additions & 0 deletions inst/test-data/specific-redcapr/read-oneshot-eav/raw-and-dag.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
structure(list(record_id = 1:5, name_first = c("Nutmeg", "Tumtum",
"Marcus", "Trudy", "John Lee"), name_last = c("Nutmouse", "Nutmouse",
"Wood", "DAG", "Walker"), address = c("14 Rose Cottage St.\nKenning UK, 323232",
"14 Rose Cottage Blvd.\nKenning UK 34243", "243 Hill St.\nGuthrie OK 73402",
"342 Elm\nDuncanville TX, 75116", "Hotel Suite\nNew Orleans LA, 70115"
), telephone = c("(405) 321-1111", "(405) 321-2222", "(405) 321-3333",
"(405) 321-4444", "(405) 321-5555"), email = c("[email protected]",
"[email protected]", "[email protected]", "[email protected]", "[email protected]"
), dob = c("2003-08-30", "2003-03-10", "1934-04-09", "1952-11-02",
"1955-04-15"), age = c(11L, 11L, 80L, 61L, 59L), sex = c(0L,
1L, 1L, 0L, 1L), height = c(7, 6, 180, 165, 193.04), weight = c(1L,
1L, 80L, 54L, 104L), bmi = c(204.1, 277.8, 24.7, 19.8, 27.9),
comments = c("Character in a book, with some guessing", "A mouse character from a good book",
"completely made up", "This record doesn't have a DAG assigned\n\nSo call up Trudy on the telephone\nSend her a letter in the mail",
"Had a hand for trouble and a eye for cash\n\nHe had a gold watch chain and a black mustache"
), mugshot = c(197977L, 197978L, 197979L, 198002L, 198021L
), race___1 = c(FALSE, FALSE, FALSE, FALSE, TRUE), race___2 = c(FALSE,
FALSE, FALSE, TRUE, FALSE), race___3 = c(FALSE, TRUE, FALSE,
FALSE, FALSE), race___4 = c(FALSE, FALSE, TRUE, FALSE, FALSE
), race___5 = c(TRUE, TRUE, TRUE, TRUE, FALSE), race___6 = c(FALSE,
FALSE, FALSE, FALSE, TRUE), ethnicity = c(1L, 1L, 0L, 1L,
2L), interpreter_needed = c(0L, 0L, 1L, NA, 0L), demographics_complete = c(2L,
2L, 2L, 2L, 2L), health_complete = c(1L, 0L, 2L, 2L, 0L),
race_and_ethnicity_complete = c(2L, 0L, 2L, 2L, 2L)), row.names = c(NA,
-5L), class = c("tbl_df", "tbl", "data.frame"))
25 changes: 25 additions & 0 deletions inst/test-data/specific-redcapr/read-oneshot-eav/raw.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
structure(list(record_id = 1:5, name_first = c("Nutmeg", "Tumtum",
"Marcus", "Trudy", "John Lee"), name_last = c("Nutmouse", "Nutmouse",
"Wood", "DAG", "Walker"), address = c("14 Rose Cottage St.\nKenning UK, 323232",
"14 Rose Cottage Blvd.\nKenning UK 34243", "243 Hill St.\nGuthrie OK 73402",
"342 Elm\nDuncanville TX, 75116", "Hotel Suite\nNew Orleans LA, 70115"
), telephone = c("(405) 321-1111", "(405) 321-2222", "(405) 321-3333",
"(405) 321-4444", "(405) 321-5555"), email = c("[email protected]",
"[email protected]", "[email protected]", "[email protected]", "[email protected]"
), dob = c("2003-08-30", "2003-03-10", "1934-04-09", "1952-11-02",
"1955-04-15"), age = c(11L, 11L, 80L, 61L, 59L), sex = c(0L,
1L, 1L, 0L, 1L), height = c(7, 6, 180, 165, 193.04), weight = c(1L,
1L, 80L, 54L, 104L), bmi = c(204.1, 277.8, 24.7, 19.8, 27.9),
comments = c("Character in a book, with some guessing", "A mouse character from a good book",
"completely made up", "This record doesn't have a DAG assigned\n\nSo call up Trudy on the telephone\nSend her a letter in the mail",
"Had a hand for trouble and a eye for cash\n\nHe had a gold watch chain and a black mustache"
), mugshot = c(197977L, 197978L, 197979L, 198002L, 198021L
), race___1 = c(FALSE, FALSE, FALSE, FALSE, TRUE), race___2 = c(FALSE,
FALSE, FALSE, TRUE, FALSE), race___3 = c(FALSE, TRUE, FALSE,
FALSE, FALSE), race___4 = c(FALSE, FALSE, TRUE, FALSE, FALSE
), race___5 = c(TRUE, TRUE, TRUE, TRUE, FALSE), race___6 = c(FALSE,
FALSE, FALSE, FALSE, TRUE), ethnicity = c(1L, 1L, 0L, 1L,
2L), interpreter_needed = c(0L, 0L, 1L, NA, 0L), demographics_complete = c(2L,
2L, 2L, 2L, 2L), health_complete = c(1L, 0L, 2L, 2L, 0L),
race_and_ethnicity_complete = c(2L, 0L, 2L, 2L, 2L)), row.names = c(NA,
-5L), class = c("tbl_df", "tbl", "data.frame"))
19 changes: 19 additions & 0 deletions inst/test-data/specific-redcapr/read-oneshot-eav/specify-forms.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
structure(list(record_id = 1:5, name_first = c("Nutmeg", "Tumtum",
"Marcus", "Trudy", "John Lee"), name_last = c("Nutmouse", "Nutmouse",
"Wood", "DAG", "Walker"), address = c("14 Rose Cottage St.\nKenning UK, 323232",
"14 Rose Cottage Blvd.\nKenning UK 34243", "243 Hill St.\nGuthrie OK 73402",
"342 Elm\nDuncanville TX, 75116", "Hotel Suite\nNew Orleans LA, 70115"
), telephone = c("(405) 321-1111", "(405) 321-2222", "(405) 321-3333",
"(405) 321-4444", "(405) 321-5555"), email = c("[email protected]",
"[email protected]", "[email protected]", "[email protected]", "[email protected]"
), dob = c("2003-08-30", "2003-03-10", "1934-04-09", "1952-11-02",
"1955-04-15"), age = c(11L, 11L, 80L, 61L, 59L), sex = c(0L,
1L, 1L, 0L, 1L), race___1 = c(FALSE, FALSE, FALSE, FALSE, TRUE
), race___2 = c(FALSE, FALSE, FALSE, TRUE, FALSE), race___3 = c(FALSE,
TRUE, FALSE, FALSE, FALSE), race___4 = c(FALSE, FALSE, TRUE,
FALSE, FALSE), race___5 = c(TRUE, TRUE, TRUE, TRUE, FALSE), race___6 = c(FALSE,
FALSE, FALSE, FALSE, TRUE), ethnicity = c(1L, 1L, 0L, 1L, 2L),
interpreter_needed = c(0L, 0L, 1L, NA, 0L), demographics_complete = c(2L,
2L, 2L, 2L, 2L), race_and_ethnicity_complete = c(2L, 0L,
2L, 2L, 2L)), row.names = c(NA, -5L), class = c("tbl_df",
"tbl", "data.frame"))
Loading

0 comments on commit 8605915

Please sign in to comment.