Skip to contents

If you work with MTurk, the MTurk IDs will be stored in the participant labels variable. This function deletes this variable in $all_apps_wide and every app data frame in the list of data frames that was created by import_otree and/or all variables referring to MTurk, such as participant.mturk_worker_id.

Caution: This function does not delete the variables from the original CSV and Excel files!

Usage

delete_plabels(oTree, del_plabel = TRUE, del_mturk = TRUE)

Arguments

oTree

A list of data frames that were created by import_otree.

del_plabel

Logical. TRUE if all participant labels should be deleted.

del_mturk

Logical. TRUE if all MTurk variables should be deleted.

Value

This function returns a duplicate of the original oTree list of data frames that do not include the participant labels and/or the MTurk variables.

Examples

# Use package-internal list of oTree data frames
oTree <- gmoTree::oTree

# Show participant labels
oTree$all_apps_wide$participant.label
#>  [1] "Person1"  "Person2"  "Person4"  "Person5"  "Person6"  "Person7" 
#>  [7] "Person8"  "Person9"  "Person10" "Person1"  "Person2"  "Person3" 
#> [13] "Person4"  "Person1"  "Person2"  "Person3"  "Person4"  "Person5" 
#> [19] "Person6"  "Person1"  "Person2"  "Person3"  "Person4"  "Person2" 
#> [25] "Person3"  NA         NA         NA         NA        
oTree$survey$participant.label
#>  [1] "Person1"  "Person2"  "Person4"  "Person5"  "Person6"  "Person7" 
#>  [7] "Person8"  "Person9"  "Person10" "Person1"  "Person2"  "Person3" 
#> [13] "Person4"  "Person1"  "Person2"  "Person3"  "Person4"  "Person5" 
#> [19] "Person6"  "Person1"  "Person2"  "Person3"  "Person4"  "Person2" 
#> [25] "Person3" 

# Delete all participant labels
oTree2 <- delete_plabels(oTree)

# Show participant labels again
oTree2$all_apps_wide$participant.label
#> NULL
oTree2$survey$participant.label
#> NULL