Combine data from two versions of a test, keeping track of which questions were unchanged, moved, removed, or added.

combine_test_versions(test_a, test_b, meta_data)

Arguments

test_a

A data frame with data from Test A.

test_b

A data frame with data from Test A.

meta_data

A data frame linking Test A to Test B.

Value

A combined data frame response_data and meta_data.

Examples

library(tibble) test_a <- tribble( ~A1, ~A2, ~A3, ~A4, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1 ) test_b <- tribble( ~Q1, ~Q2, ~Q3, ~Q4, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0 ) meta_data <- tribble( ~A, ~B, "A1", "Q1", "A2", "Q3", "A3", NA, "A4", "Q2", NA, "Q4" ) combine_test_versions(test_a, test_b, meta_data)
#> $response_data #> # A tibble: 6 x 5 #> A1_B1 A2_B3 A3_B0 A4_B2 A0_B4 #> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 0 1 1 0 NA #> 2 0 0 1 1 NA #> 3 0 1 0 1 NA #> 4 1 1 NA 1 0 #> 5 0 0 NA 1 1 #> 6 0 0 NA 1 0 #> #> $meta_data #> # A tibble: 5 x 8 #> item_name id group A B test_a_name test_b_name status #> <chr> <lgl> <lgl> <dbl> <dbl> <chr> <chr> <chr> #> 1 A1_B1 NA NA 1 1 A1 Q1 unchanged #> 2 A2_B3 NA NA 2 3 A2 Q2 moved #> 3 A3_B0 NA NA 3 0 A3 Q0 removed #> 4 A4_B2 NA NA 4 2 A4 Q2 moved #> 5 A0_B4 NA NA 0 4 A0 Q4 added #>