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

Today Walkin 14th-Sept

Hibernate Search - Elasticsearch with JSON manipulation

Spring Elasticsearch Operations