In Python, we can use raw_input(), what can I use in R?
>>> raw_input("let x=3 or 4?")
let x=3 or 4?3
'3'
Try readline():
> input = readline('Enter anything: ')
Enter anything: test
> input
[1] "test"
>
Here is a better solution:
input = readline(prompt="Enter anything: ")
This will will work in a interactive session
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With