list - Looping through variables to subset -
i have same data exported game experiment. files json , each respondent given specific code name a001 a010 , b001 b010. json file in list survey responses, player moves, , player messages.
i want subset player response questions multiple data sets, each player getting object.
names.list <- names(data$surveys) survey.results <- sapply(names.list, function(x) { x <- data$surveys$x })
namelist = a001, a002, a003...b010. know how hard code this, have varying numbers of participants different experiments, , easier if can write loop through player codes.
Comments
Post a Comment