I have a portion of code that "sounds" like:
bla bla () <- bla R stuff bla
...
p <- readline()
cat("This is the amazing parameter ",p)
It obvioulsy works on the command line. The problem is that Rstudio have issues about with the interactivity.
So, there exists a way in which R understand if you're typing from a command line or from Rstudio. Something like:
bla bla () <- bla R stuff bla
...
if(RstudioInput() == true){
p <- "param"
} else {
p <- readline()
}
cat("Again, this is the awesome parameter ",p)
Summarizing, I need to know both if the code is running from Rstudio and also if the code is running from the command-line.