For example, if I need that the user specifies the number of rows and columns of a matrix:
PROMPT: Number of rows?:
USER INPUT: [a number]
I need that R 'waits' for the input. Then save [a number] into a variable v1. Next,
PROMPT: Number of columns?:
USER INPUT: [another number]
Also save [another number] into a variable v2. At the end, I will have two variables (v1, v2) that will be used in the rest of the code.
"readline" only works for one input at a time. I can't run the two lines together
v1 <- readline("Number of rows?: ")
v2 <- readline("Number of columns?: ")
Any ideas or suggestions?
Thank you in advance