I am attempting to create a looping block of code in an R script that calls different row numbers each time through. I had thought to create a value n that increases by 1 each loop.
n <- 1
paste("choice", n, sep = "") <- readline(prompt = paste("Enter reference file for ", filenames[n], " and ", filenames[n+1], ": ))
some.function
some.function
some.function
n <- n+1
And so on. My hangup currently is that I can't seem to figure out how to get the user input to output to the paste function. When I try this current format I receive the error "target of assignment expands to non-language object". Is there any way for me to do this or am I barking up the wrong tree?