I'd like a readline() function to use the strings stored to a variable rather than convert the word used for the variable into the string. Is there a way I can do this?
For example, say I have the following variables and desired prompt:
> SpringC = c("Red", "Orange", "Yellow", "Green")
> WinterC = c("Blue", "White", "Purple", "Grey")
> x <- readline("Enter Season Color: ")
From this I'd like it if this would happen is:
Enter Season Color: WinterC
> x <- as.character(unlist(strsplit(x, ",")))
> x
"Blue" "White" "Purple" "Grey"
Rather than what actually happens:
Enter Season Color: WinterC
> x <- as.character(unlist(strsplit(x, ",")))
> x
"WinterC"