secuTrialdata
objectsR/diff_secuTrial.R
diff_secuTrial.Rd
During ongoing studies it is possible that changes to the DataCapture interface
are made. Sometimes these changes may call for adjustments in analysis code.
It is considered good practice to run diff_secuTrial()
on the last export
and the current export of a project to at least make yourself aware of
potential changes to the setup. If there are differences, the results of this function should
be interpreted as a first indicator since they may not cover all alterations.
Information is returned on new forms and variables.
A detailed list of changes can be produced in the FormBuilder with
"Compare project setup".
diff_secuTrial(x, y)
a secuTrialdata
object (the older export)
a secuTrialdata
object (the newer export)
If there are differences, diff_secuTrial()
will produce a list of vectors.
The fist vector informs about new forms and the second vector informs about
new variables.
# read exports
# v1 is essentially a clone of the CTU05 setup
ctu06_v1 <- read_secuTrial(system.file("extdata", "sT_exports", "change_tracking",
"s_export_CSV-xls_CTU06_version1.zip",
package = "secuTrialR"))
#> Read export successfully.
#> The following export options deviate from the suggested specifications:
#> Data from hidden fields is part of the export.
#> Short names was not selected.
# v2 contains 2 additional forms (mnpctu06anewform, mnpctu06anothernewform) and
# 2 additional variables (new_item_in_fu, new_item_in_new_form)
ctu06_v2 <- read_secuTrial(system.file("extdata", "sT_exports", "change_tracking",
"s_export_CSV-xls_CTU06_version2.zip",
package = "secuTrialR"))
#> Read export successfully.
#> The following export options deviate from the suggested specifications:
#> Data from hidden fields is part of the export.
# return diff
diff_secuTrial(ctu06_v1, ctu06_v2)
#> $new_forms
#> [1] "mnpctu06anewform" "mnpctu06anothernewform"
#>
#> $new_variables
#> [1] "new_item_in_fu" "new_item_in_new_form"
#>
#> $removed_forms
#> character(0)
#>
#> $removed_variables
#> character(0)
#>