The function readline
in R is similar to raw_input
in python, both allow to pass interactive arguments.
However, when I run a R script in terminal, It does not work.
Here is a example txt.R
:
#!/usr/bin/env Rscript
x = readline('Hello?')
print(x)
Run ./txt.R
in terminal, it just print out:
Hello?
[1] ""
does not wait for my input. So how to fix it?