Command line issues in R

I am creating an input user interface in R.

Downloading the program, I would like to ask the user that their preferences correspond to a set of 6 fields. This will then be used as a comparison tool for the rest of the program.

eg.

>ThisProgram >"Hello, on a scale of 1 to 10, how much would you say you rate the outdoors in your trips? Enter a 10 for very important, and a 1 for not important at all. >7 >"Great. on a scale of 1 to 10, how much would you say you rate the Family Friendly in your trips? Enter a 10 for very important, and a 1 for not important at all. >2 . . . and so on... 

How do I get R to ask the user a question and then save the answer in a vector?

+4
source share
1 answer

See ?readline

 > x <- readline("What is your name? ") What is your name? Josh > x [1] "Josh" 
+5
source

All Articles