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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -