Reputation: 247
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'
Upvotes: 2
Views: 4766
Reputation: 301
... even more python-ish:
(readline(prompt = 'Enter anything: '))
Upvotes: 0
Reputation: 31
Here is a better solution:
input = readline(prompt="Enter anything: ")
This will will work in a interactive session
Upvotes: 3
Reputation: 10923
Try readline()
:
> input = readline('Enter anything: ')
Enter anything: test
> input
[1] "test"
>
Upvotes: 8