# 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()
# Show the structure of the import
str(oTree, max.level = 1)
# Show the names of all imported files
oTree$info$imported_files
# Delete empty cases and delete every case of a person
# who didn't end the experiment in the app "survey"
oTree <- import_otree(
del_empty = TRUE,
final_apps = "survey",
info = TRUE)
# Show the structure of the import
str(oTree, max.level = 1)
# Import bot files
import_otree(
path = "./bot_data",
onlybots = TRUE,
csv = TRUE,
info = TRUE)
# Show the structure of the import
str(oTree, max.level = 1)
# Import with file names (path separately)
oTree2 <- import_otree(
del_empty = TRUE,
path = "./exp_data",
file_names = c("all_apps_wide-2023-03-27.csv",
"ChatMessages-2023-03-27.csv",
"PageTimes-2023-03-27.csv"),
onlybots = FALSE,
csv = TRUE,
info = TRUE)
# Show the structure of the import
str(oTree, max.level = 1)
# Import with file names (without path separately)
oTree2 <- import_otree(
del_empty = TRUE,
file_names = c("exp_data/all_apps_wide-2023-03-27.csv",
"exp_data/ChatMessages-2023-03-27.csv",
"exp_data/PageTimes-2023-03-27.csv"),
onlybots = FALSE,
csv = TRUE,
info = TRUE)
# Show the structure of the import
str(oTree, max.level = 1)
})
Run the code above in your browser using DataLab