Skip to content

Commit

Permalink
update expectation for read-oneshot
Browse files Browse the repository at this point in the history
ref #313
  • Loading branch information
wibeasley committed Nov 18, 2020
1 parent fac0db9 commit 9058eb2
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 57 deletions.
18 changes: 9 additions & 9 deletions inst/test-data/specific-redcapr/read-oneshot/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"))
14 changes: 7 additions & 7 deletions inst/test-data/specific-redcapr/read-oneshot/default.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ 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)), class = "data.frame", row.names = c(NA, -5L), spec = structure(list(
cols = list(record_id = structure(list(), class = c("collector_double",
Expand Down Expand Up @@ -47,4 +47,4 @@ structure(list(record_id = c(1, 2, 3, 4, 5), name_first = c("Nutmeg",
"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"))
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 Down Expand Up @@ -54,4 +54,4 @@ structure(list(record_id = c(1, 2, 3, 4, 5), name_first = c("Nutmeg",
"collector")), interpreter_needed = structure(list(), class = c("collector_logical",
"collector")), race_and_ethnicity_complete = structure(list(), class = c("collector_character",
"collector"))), default = structure(list(), class = c("collector_guess",
"collector")), skip = 1), class = "col_spec"))
"collector")), skip = 1L), class = "col_spec"))
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +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), class = "data.frame", row.names = c(NA,
-1L), spec = structure(list(cols = list(record_id = structure(list(), class = c("collector_double",
Expand Down Expand Up @@ -32,4 +32,4 @@ structure(list(record_id = 5, name_first = "John Lee", name_last = "Walker",
"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"))
4 changes: 2 additions & 2 deletions inst/test-data/specific-redcapr/read-oneshot/filter-numeric.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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,
Expand Down Expand Up @@ -37,4 +37,4 @@ structure(list(record_id = c(3, 4), name_first = c("Marcus",
"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"))
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ structure(list(record_id = c("1", "2", "3", "4", "5"), name_first = c("Nutmeg",
"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("[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",
"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("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")), class = "data.frame", 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",
Expand Down Expand Up @@ -49,4 +48,4 @@ structure(list(record_id = c("1", "2", "3", "4", "5"), name_first = c("Nutmeg",
"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"))
"collector")), skip = 1L), class = "col_spec"))
6 changes: 3 additions & 3 deletions inst/test-data/specific-redcapr/read-oneshot/label-and-dag.R
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 Down Expand Up @@ -56,4 +56,4 @@ structure(list(record_id = c(1, 2, 3, 4, 5), redcap_data_access_group = c("dag_1
"collector")), interpreter_needed = structure(list(), class = c("collector_logical",
"collector")), race_and_ethnicity_complete = structure(list(), class = c("collector_character",
"collector"))), default = structure(list(), class = c("collector_guess",
"collector")), skip = 1), class = "col_spec"))
"collector")), skip = 1L), class = "col_spec"))
8 changes: 4 additions & 4 deletions inst/test-data/specific-redcapr/read-oneshot/label-header.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ structure(list(`Study ID` = c(1, 2, 3, 4, 5), `First Name` = 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]"), `Complete?_1` = c(1, 0, 2, 2,
0), `Race (Select all that apply) (choice=American Indian/Alaska Native)` = c(0,
), Mugshot = c("mugshot-1.jpg", "mugshot-2.jpg", "mugshot-3.jpg",
"mugshot-4.jpg", "mugshot-5.jpg"), `Complete?_1` = c(1, 0,
2, 2, 0), `Race (Select all that apply) (choice=American Indian/Alaska Native)` = c(0,
0, 0, 0, 1), `Race (Select all that apply) (choice=Asian)` = c(0,
0, 0, 1, 0), `Race (Select all that apply) (choice=Native Hawaiian or Other Pacific Islander)` = c(0,
1, 0, 0, 0), `Race (Select all that apply) (choice=Black or African American)` = c(0,
Expand Down Expand Up @@ -50,4 +50,4 @@ structure(list(`Study ID` = c(1, 2, 3, 4, 5), `First Name` = c("Nutmeg",
"collector")), `Are interpreter services requested?` = structure(list(), class = c("collector_double",
"collector")), `Complete?_2` = 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"))
6 changes: 3 additions & 3 deletions inst/test-data/specific-redcapr/read-oneshot/label.R
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("Unchecked",
"Unchecked", "Unchecked", "Unchecked", "Checked"), race___2 = c("Unchecked",
"Unchecked", "Unchecked", "Checked", "Unchecked"), race___3 = c("Unchecked",
Expand Down Expand Up @@ -54,4 +54,4 @@ structure(list(record_id = c(1, 2, 3, 4, 5), name_first = c("Nutmeg",
"collector")), interpreter_needed = structure(list(), class = c("collector_logical",
"collector")), race_and_ethnicity_complete = structure(list(), class = c("collector_character",
"collector"))), default = structure(list(), class = c("collector_guess",
"collector")), skip = 1), class = "col_spec"))
"collector")), skip = 1L), class = "col_spec"))
14 changes: 7 additions & 7 deletions inst/test-data/specific-redcapr/read-oneshot/raw-and-dag.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ structure(list(record_id = c(1, 2, 3, 4, 5), redcap_data_access_group = c("dag_1
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)), class = "data.frame", row.names = c(NA, -5L), spec = structure(list(
cols = list(record_id = structure(list(), class = c("collector_double",
Expand Down Expand Up @@ -49,4 +49,4 @@ structure(list(record_id = c(1, 2, 3, 4, 5), redcap_data_access_group = c("dag_1
"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"))
14 changes: 7 additions & 7 deletions inst/test-data/specific-redcapr/read-oneshot/raw.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ 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)), class = "data.frame", row.names = c(NA, -5L), spec = structure(list(
cols = list(record_id = structure(list(), class = c("collector_double",
Expand Down Expand Up @@ -47,4 +47,4 @@ structure(list(record_id = c(1, 2, 3, 4, 5), name_first = c("Nutmeg",
"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"))
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ structure(list(record_id = c(1, 2, 3, 4, 5), name_first = c("Nutmeg",
"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"))

0 comments on commit 9058eb2

Please sign in to comment.