ohh nice!<br><br>But still, I don't understand why you consider pmin and pmax as primitives?<br><br>Even if they are part of the base package it's not right to consider them as primitive of the R language!<br><br>You can check:<br>
.Primitive('pmax')<div><br><div>It will give you an error!</div><div><br><br><br><br>On Mon, Nov 19, 2012 at 6:36 PM, Hadley Wickham <<a href="mailto:h.wickham@gmail.com">h.wickham@gmail.com</a>> wrote:<br>><br>
> > To be fair with the R language, I would have compare with the use of real<br>> > primitives :<br>> ><br>> > vaccBubu <- function(age, female, ily) {<br>> > gender <- female * 1.25<br>
> > gender[!female] <- 0.75<br>> > p <- (0.25 + 0.3 * 1 / (1 - exp(0.04 * age)) + 0.1 * ily) * gender<br>> > p[p < 0] <- 0<br>> > p[p > 1] <- 1<br>> > p<br>
> > }<br>> ><br>><br>> I think you could do it a bit more elegantly with<br>><br>> gender <- 0.75 + female * 0.5<br>><br>> but pmin and pmax are "real" primitives, so I think it's fine to use them.<br>
><br>> Hadley<br>><br>><br>> --<br>> RStudio / Rice University<br>> <a href="http://had.co.nz/">http://had.co.nz/</a></div></div>