Amazing technological breakthrough possible @S-Logix

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • +91- 81240 01111

Social List

How to get User Input in R?


To get the user input using R programming.


   R Function : readLine() or readLines()

Sapmle Code

#How to get User Input

name<-readline(prompt = “Enter Your Name : “)
age<-readline(prompt = “Enter Your Age : “)
val<-18-as.integer(age) if(age>=18)
cat(“Hello”,name,”You are eligible for voting :)”)
cat(“Oops!!!”,name,”You are not eligible for voting \n You need”,val,”more years for voting”)

get User Input in R