You did not give me much context or reproducible code, so I will just give a simple example. I am not familiar with the Rdsn package, so I will use the provided solution that I know.
# create a function to prompt the user for some input readstuff = function(){ stuff = readline(prompt = "Enter some stuff: ")
The key here is the "source" script instead of the "run". You can find the "source" button in the upper right corner of RStudio. You can also use source(yourscript) for its source.
So, for each parameter that you want to ask the user for input, just call readstuff() . You can also tweak it a bit to make it more general. For instance:
# create a function to prompt the user for some input readstuff = function(promptMessage = "stuff", class = "integer"){ stuff = readline(prompt = paste("Enter the", promptMessage, ": "))
The if(is.na(stuff)) will not work if the class is a character, but I will not go into details on how to fix this, since this question mainly concerns how to wait for user input. There are also ways to suppress warning messages if the user entered something other than what was intended, but again, a little off topic to talk about it here.
One important thing you should pay attention to is that you want R to print or draw, you need to wrap it with the print() function. Otherwise, the search will not print and do nothing. Also, when entering a parameter that is intended for a string or character, do not add quotation marks. For example, for plotColor, enter red instead of βredβ in the tooltip.
In most cases, the readline code refers to here :
source share