title: How to restrict input values in custom function in R?
body: <p>I wrote a customized em algorithm functions. I have three parameters to be estimated. These three parameters are all between 0 and 1, and add up to 1. So I think I only need to put two parameters, alpha and beta, in my function, the third parameter will be 1-alpha-beta. My question is how to let the function know that these two input can only take values between 0 and 1?</p>