delete_duplicate {gmoTree} | R Documentation |
Delete duplicate data
Description
Delete duplicate rows from all oTree app data frames and all_apps_wide.
Usage
delete_duplicate(oTree)
Arguments
oTree |
A list of data frames that were created by import_otree(). |
Value
This function returns a duplicate of the original oTree list of data frames but without duplicate rows in all app data frames and all_apps_wide. This function has no effect on the data frames Time and Chats.
This function does NOT add information to $info$deleted_cases, because it does not delete any important information but only cleans up a messy data import.
However, the function adjusts info$initial_n, if an all_apps_wide data frame exists.
Examples
# Set data folder first
withr::with_dir(system.file("extdata", package = "gmoTree"), {
# Import all oTree files in this folder and its subfolders
oTree <- import_otree()
})
# First, show some row numbers
print(paste(nrow(oTree$all_apps_wide), nrow(oTree$survey),
nrow(oTree$Time), nrow(oTree$Chats)))
# Delete duplicate rows
oTree <- delete_duplicate(oTree)
# Show row numbers again
print(paste(nrow(oTree$all_apps_wide), nrow(oTree$survey),
nrow(oTree$Time), nrow(oTree$Chats)))
[Package gmoTree version 1.0.1 Index]