How to add user input value in R

103 Views Asked by At

I am trying to add user input value, both input values given as 5 or it can be anything

x <- as.numeric(readline("add value of 5:"));
x1 <- as.numeric(readline("add value of 5:"))
1

There are 1 best solutions below

2
On

Well, you answered your own question: y = x + x1 or y <- x + x1.