I would like to automatically create a number of elements inside a for loop, but still have them when the loop ends. The elements have to be named based on the loop variable.
for(i in letters){
paste(c('student', i), collapse = '') = classroom[i]
}
however i get the following error message:
paste(c('student', i), collapse = '') = classroom[i] :
target of assignment expands to non-language object
is there a way to create and name new objects inside a for loop based on the loop variable?