# Use package-internal list of oTree data frames
oTree <- gmoTree::oTree
# Assign variable "survey.1.player.gender" and name it "gender"
oTree <- assignv(oTree = oTree,
variable = "survey.1.player.gender",
newvar = "gender")
# Show the new variable in some of the other app data frames
oTree$dictator$gender
oTree$chatapp$gender
# The variable is now duplicated in app "survey" because it is obtained from
# there (This can be avoided by naming the new variable the same as the old
# variable)
oTree$survey$gender
oTree$survey$player.gender
# In app "all_apps_wide," the variable is also there twice (This can be
# avoided by naming the new variable the same as the old variable)
oTree$all_apps_wide$gender
oTree$all_apps_wide$survey.1.player.gender
Run the code above in your browser using DataLab