Parametrize a function with a variable. Then delete the variable

I would like to make the following code run:

mu = 5
rnorm2 <- function(N) rnorm(N, mean = mu, sd = 1)

And then be able to use the rnorm2 function regardless of the presence of the mu variable in the environment. In other words, set the value of the 'mean' argument with the "mu" value once and for all.

Is that possible ?



from Recent Questions - Stack Overflow https://ift.tt/3EpkHgm
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

I get wrong characters when retreiving the message body of an email using TIdIMAP4.UIDRetrieveTextPeek2()

How to drop the all the 1's in a correlation matrix

Today Walkin 14th-Sept