Skip to content

Commit

Permalink
update expectations for read-batch-simple
Browse files Browse the repository at this point in the history
ref #313
  • Loading branch information
wibeasley committed Nov 18, 2020
1 parent 3c41dd4 commit 37dd2d8
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 339 deletions.
18 changes: 9 additions & 9 deletions inst/test-data/specific-redcapr/read-batch-simple/col_types.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ structure(list(record_id = 1:5, name_first = c("Nutmeg", "Tumtum",
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("[document]", "[document]", "[document]",
"[document]", "[document]"), health_complete = c(1, 0, 2,
2, 0), 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(1, 1, 0, 1, 2),
interpreter_needed = c(0, 0, 1, NA, 0), race_and_ethnicity_complete = c(2,
), mugshot = c("mugshot-1.jpg", "mugshot-2.jpg", "mugshot-3.jpg",
"mugshot-4.jpg", "mugshot-5.jpg"), health_complete = c(1,
0, 2, 2, 0), 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(1,
1, 0, 1, 2), interpreter_needed = c(0, 0, 1, NA, 0), race_and_ethnicity_complete = c(2,
0, 2, 2, 2)), class = "data.frame", row.names = c(NA, -5L
), spec = structure(list(cols = list(record_id = structure(list(), class = c("collector_integer",
"collector")), name_first = structure(list(), class = c("collector_character",
Expand Down Expand Up @@ -48,4 +48,4 @@ structure(list(record_id = 1:5, name_first = c("Nutmeg", "Tumtum",
"collector")), interpreter_needed = structure(list(), class = c("collector_double",
"collector")), race_and_ethnicity_complete = structure(list(), class = c("collector_double",
"collector"))), default = structure(list(), class = c("collector_guess",
"collector")), skip = 1), class = "col_spec"))
"collector")), skip = 1L), class = "col_spec"))
41 changes: 7 additions & 34 deletions inst/test-data/specific-redcapr/read-batch-simple/default.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,11 @@ structure(list(record_id = c(1, 2, 3, 4, 5), name_first = c("Nutmeg",
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("[document]", "[document]", "[document]",
"[document]", "[document]"), health_complete = c(1, 0, 2,
2, 0), race___1 = c(0, 0, 0, 0, 1), race___2 = c(0, 0, 0,
1, 0), race___3 = c(0, 1, 0, 0, 0), race___4 = c(0, 0, 1,
0, 0), race___5 = c(1, 1, 1, 1, 0), race___6 = c(0, 0, 0,
0, 1), ethnicity = c(1, 1, 0, 1, 2), interpreter_needed = c(0,
), mugshot = c("mugshot-1.jpg", "mugshot-2.jpg", "mugshot-3.jpg",
"mugshot-4.jpg", "mugshot-5.jpg"), health_complete = c(1,
0, 2, 2, 0), race___1 = c(0, 0, 0, 0, 1), race___2 = c(0,
0, 0, 1, 0), race___3 = c(0, 1, 0, 0, 0), race___4 = c(0,
0, 1, 0, 0), race___5 = c(1, 1, 1, 1, 0), race___6 = c(0,
0, 0, 0, 1), ethnicity = c(1, 1, 0, 1, 2), interpreter_needed = c(0,
0, 1, NA, 0), race_and_ethnicity_complete = c(2, 0, 2, 2,
2)), row.names = c(NA, -5L), spec = structure(list(cols = list(
record_id = structure(list(), class = c("collector_character",
"collector")), name_first = structure(list(), class = c("collector_character",
"collector")), name_last = structure(list(), class = c("collector_character",
"collector")), address = structure(list(), class = c("collector_character",
"collector")), telephone = structure(list(), class = c("collector_character",
"collector")), email = structure(list(), class = c("collector_character",
"collector")), dob = structure(list(), class = c("collector_character",
"collector")), age = structure(list(), class = c("collector_character",
"collector")), sex = structure(list(), class = c("collector_character",
"collector")), demographics_complete = structure(list(), class = c("collector_character",
"collector")), height = structure(list(), class = c("collector_character",
"collector")), weight = structure(list(), class = c("collector_character",
"collector")), bmi = structure(list(), class = c("collector_character",
"collector")), comments = structure(list(), class = c("collector_character",
"collector")), mugshot = structure(list(), class = c("collector_character",
"collector")), health_complete = structure(list(), class = c("collector_character",
"collector")), race___1 = structure(list(), class = c("collector_character",
"collector")), race___2 = structure(list(), class = c("collector_character",
"collector")), race___3 = structure(list(), class = c("collector_character",
"collector")), race___4 = structure(list(), class = c("collector_character",
"collector")), race___5 = structure(list(), class = c("collector_character",
"collector")), race___6 = structure(list(), class = c("collector_character",
"collector")), ethnicity = structure(list(), class = c("collector_character",
"collector")), interpreter_needed = structure(list(), class = c("collector_character",
"collector")), race_and_ethnicity_complete = structure(list(), class = c("collector_character",
"collector"))), default = structure(list(), class = c("collector_character",
"collector")), skip = 1), class = "col_spec"), class = "data.frame")
2)), row.names = c(NA, -5L), class = "data.frame")
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ structure(list(record_id = c(1, 2, 3, 4, 5), name_first = c("Nutmeg",
"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("[document]", "[document]", "[document]",
"[document]", "[document]"), health_complete = c("Unverified",
), mugshot = c("mugshot-1.jpg", "mugshot-2.jpg", "mugshot-3.jpg",
"mugshot-4.jpg", "mugshot-5.jpg"), health_complete = c("Unverified",
"Incomplete", "Complete", "Complete", "Incomplete"), race___1 = c(NA,
NA, NA, NA, "American Indian/Alaska Native"), race___2 = c(NA,
NA, NA, "Asian", NA), race___3 = c(NA, "Native Hawaiian or Other Pacific Islander",
Expand All @@ -28,30 +28,4 @@ structure(list(record_id = c(1, 2, 3, 4, 5), name_first = c("Nutmeg",
), interpreter_needed = c(FALSE, FALSE, TRUE, NA, FALSE),
race_and_ethnicity_complete = c("Complete", "Incomplete",
"Complete", "Complete", "Complete")), row.names = c(NA, -5L
), spec = structure(list(cols = list(record_id = structure(list(), class = c("collector_character",
"collector")), name_first = structure(list(), class = c("collector_character",
"collector")), name_last = structure(list(), class = c("collector_character",
"collector")), address = structure(list(), class = c("collector_character",
"collector")), telephone = structure(list(), class = c("collector_character",
"collector")), email = structure(list(), class = c("collector_character",
"collector")), dob = structure(list(), class = c("collector_character",
"collector")), age = structure(list(), class = c("collector_character",
"collector")), sex = structure(list(), class = c("collector_character",
"collector")), demographics_complete = structure(list(), class = c("collector_character",
"collector")), height = structure(list(), class = c("collector_character",
"collector")), weight = structure(list(), class = c("collector_character",
"collector")), bmi = structure(list(), class = c("collector_character",
"collector")), comments = structure(list(), class = c("collector_character",
"collector")), mugshot = structure(list(), class = c("collector_character",
"collector")), health_complete = structure(list(), class = c("collector_character",
"collector")), race___1 = structure(list(), class = c("collector_character",
"collector")), race___2 = structure(list(), class = c("collector_character",
"collector")), race___3 = structure(list(), class = c("collector_character",
"collector")), race___4 = structure(list(), class = c("collector_character",
"collector")), race___5 = structure(list(), class = c("collector_character",
"collector")), race___6 = structure(list(), class = c("collector_character",
"collector")), ethnicity = structure(list(), class = c("collector_character",
"collector")), interpreter_needed = structure(list(), class = c("collector_character",
"collector")), race_and_ethnicity_complete = structure(list(), class = c("collector_character",
"collector"))), default = structure(list(), class = c("collector_character",
"collector")), skip = 1), class = "col_spec"), class = "data.frame")
), class = "data.frame")
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,7 @@ structure(list(record_id = 5, name_first = "John Lee", name_last = "Walker",
email = "[email protected]", dob = structure(-5375, class = "Date"),
age = 59, sex = 1, demographics_complete = 2, height = 193.04,
weight = 104, 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 = "[document]", health_complete = 0, race___1 = 1,
mugshot = "mugshot-5.jpg", health_complete = 0, race___1 = 1,
race___2 = 0, race___3 = 0, race___4 = 0, race___5 = 0, race___6 = 1,
ethnicity = 2, interpreter_needed = 0, race_and_ethnicity_complete = 2), row.names = c(NA,
-1L), spec = structure(list(cols = list(record_id = structure(list(), class = c("collector_character",
"collector")), name_first = structure(list(), class = c("collector_character",
"collector")), name_last = structure(list(), class = c("collector_character",
"collector")), address = structure(list(), class = c("collector_character",
"collector")), telephone = structure(list(), class = c("collector_character",
"collector")), email = structure(list(), class = c("collector_character",
"collector")), dob = structure(list(), class = c("collector_character",
"collector")), age = structure(list(), class = c("collector_character",
"collector")), sex = structure(list(), class = c("collector_character",
"collector")), demographics_complete = structure(list(), class = c("collector_character",
"collector")), height = structure(list(), class = c("collector_character",
"collector")), weight = structure(list(), class = c("collector_character",
"collector")), bmi = structure(list(), class = c("collector_character",
"collector")), comments = structure(list(), class = c("collector_character",
"collector")), mugshot = structure(list(), class = c("collector_character",
"collector")), health_complete = structure(list(), class = c("collector_character",
"collector")), race___1 = structure(list(), class = c("collector_character",
"collector")), race___2 = structure(list(), class = c("collector_character",
"collector")), race___3 = structure(list(), class = c("collector_character",
"collector")), race___4 = structure(list(), class = c("collector_character",
"collector")), race___5 = structure(list(), class = c("collector_character",
"collector")), race___6 = structure(list(), class = c("collector_character",
"collector")), ethnicity = structure(list(), class = c("collector_character",
"collector")), interpreter_needed = structure(list(), class = c("collector_character",
"collector")), race_and_ethnicity_complete = structure(list(), class = c("collector_character",
"collector"))), default = structure(list(), class = c("collector_character",
"collector")), skip = 1), class = "col_spec"), class = "data.frame")
-1L), class = "data.frame")
31 changes: 2 additions & 29 deletions inst/test-data/specific-redcapr/read-batch-simple/filter-numeric.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,8 @@ structure(list(record_id = c(3, 4), name_first = c("Marcus",
61), sex = c(1, 0), demographics_complete = c(2, 2), height = c(180,
165), weight = c(80, 54), 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("[document]", "[document]"), health_complete = c(2,
), mugshot = c("mugshot-3.jpg", "mugshot-4.jpg"), health_complete = c(2,
2), race___1 = c(0, 0), race___2 = c(0, 1), race___3 = c(0, 0
), race___4 = c(1, 0), race___5 = c(1, 1), race___6 = c(0, 0),
ethnicity = c(0, 1), interpreter_needed = c(1, NA), race_and_ethnicity_complete = c(2,
2)), row.names = c(NA, -2L), spec = structure(list(cols = list(
record_id = structure(list(), class = c("collector_character",
"collector")), name_first = structure(list(), class = c("collector_character",
"collector")), name_last = structure(list(), class = c("collector_character",
"collector")), address = structure(list(), class = c("collector_character",
"collector")), telephone = structure(list(), class = c("collector_character",
"collector")), email = structure(list(), class = c("collector_character",
"collector")), dob = structure(list(), class = c("collector_character",
"collector")), age = structure(list(), class = c("collector_character",
"collector")), sex = structure(list(), class = c("collector_character",
"collector")), demographics_complete = structure(list(), class = c("collector_character",
"collector")), height = structure(list(), class = c("collector_character",
"collector")), weight = structure(list(), class = c("collector_character",
"collector")), bmi = structure(list(), class = c("collector_character",
"collector")), comments = structure(list(), class = c("collector_character",
"collector")), mugshot = structure(list(), class = c("collector_character",
"collector")), health_complete = structure(list(), class = c("collector_character",
"collector")), race___1 = structure(list(), class = c("collector_character",
"collector")), race___2 = structure(list(), class = c("collector_character",
"collector")), race___3 = structure(list(), class = c("collector_character",
"collector")), race___4 = structure(list(), class = c("collector_character",
"collector")), race___5 = structure(list(), class = c("collector_character",
"collector")), race___6 = structure(list(), class = c("collector_character",
"collector")), ethnicity = structure(list(), class = c("collector_character",
"collector")), interpreter_needed = structure(list(), class = c("collector_character",
"collector")), race_and_ethnicity_complete = structure(list(), class = c("collector_character",
"collector"))), default = structure(list(), class = c("collector_character",
"collector")), skip = 1), class = "col_spec"), class = "data.frame")
2)), row.names = c(NA, -2L), class = "data.frame")
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ structure(list(record_id = c(1, 2, 3, 4, 5), redcap_data_access_group = c("dag_1
"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("[document]", "[document]", "[document]",
"[document]", "[document]"), health_complete = c("Unverified",
), mugshot = c("mugshot-1.jpg", "mugshot-2.jpg", "mugshot-3.jpg",
"mugshot-4.jpg", "mugshot-5.jpg"), health_complete = c("Unverified",
"Incomplete", "Complete", "Complete", "Incomplete"), race___1 = c("Unchecked",
"Unchecked", "Unchecked", "Unchecked", "Checked"), race___2 = c("Unchecked",
"Unchecked", "Unchecked", "Checked", "Unchecked"), race___3 = c("Unchecked",
Expand All @@ -29,31 +29,4 @@ structure(list(record_id = c(1, 2, 3, 4, 5), redcap_data_access_group = c("dag_1
"Hispanic or Latino"), interpreter_needed = c(FALSE, FALSE,
TRUE, NA, FALSE), race_and_ethnicity_complete = c("Complete",
"Incomplete", "Complete", "Complete", "Complete")), row.names = c(NA,
-5L), spec = structure(list(cols = list(record_id = structure(list(), class = c("collector_character",
"collector")), redcap_data_access_group = structure(list(), class = c("collector_character",
"collector")), name_first = structure(list(), class = c("collector_character",
"collector")), name_last = structure(list(), class = c("collector_character",
"collector")), address = structure(list(), class = c("collector_character",
"collector")), telephone = structure(list(), class = c("collector_character",
"collector")), email = structure(list(), class = c("collector_character",
"collector")), dob = structure(list(), class = c("collector_character",
"collector")), age = structure(list(), class = c("collector_character",
"collector")), sex = structure(list(), class = c("collector_character",
"collector")), demographics_complete = structure(list(), class = c("collector_character",
"collector")), height = structure(list(), class = c("collector_character",
"collector")), weight = structure(list(), class = c("collector_character",
"collector")), bmi = structure(list(), class = c("collector_character",
"collector")), comments = structure(list(), class = c("collector_character",
"collector")), mugshot = structure(list(), class = c("collector_character",
"collector")), health_complete = structure(list(), class = c("collector_character",
"collector")), race___1 = structure(list(), class = c("collector_character",
"collector")), race___2 = structure(list(), class = c("collector_character",
"collector")), race___3 = structure(list(), class = c("collector_character",
"collector")), race___4 = structure(list(), class = c("collector_character",
"collector")), race___5 = structure(list(), class = c("collector_character",
"collector")), race___6 = structure(list(), class = c("collector_character",
"collector")), ethnicity = structure(list(), class = c("collector_character",
"collector")), interpreter_needed = structure(list(), class = c("collector_character",
"collector")), race_and_ethnicity_complete = structure(list(), class = c("collector_character",
"collector"))), default = structure(list(), class = c("collector_character",
"collector")), skip = 1), class = "col_spec"), class = "data.frame")
-5L), class = "data.frame")
Loading

0 comments on commit 37dd2d8

Please sign in to comment.