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

Ansible warning on jinja2 braces on when -

Parsing a protocol message from Go by Java -

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