I have a function which requests numeric input from the user as follows:
request_KBEHAVIOR<-function()
{
as.numeric(readline("Please enter Kramer's behavior>>> "))
}
So Kramer’s behavior is a value between 0 and 1 (a probability), and a user would enter in something like “.5”
However, I’d also like the user to input an equation like =1/exp(runif(1)). Is this possible?
For instance in excel, you can type a value into a cell, or you can type a function like =1/exp(rand()) and you can reference that cell in any other equation. Thank you so much for your help in advance.
You can use
eval(parse(text=...)):