Data Science Desktop Survival Guide
by Graham Williams |
|||||
Function Guidelines |
20200105
Preferred
factorial <- function(x)
{ if (x==1) { result <- 1 } else { result <- x * factorial(x-1) } return(result) }
Alternative |
factorial <- function(x)
{ if (x==1) { return(1) } else { return(x * factorial(x-1)) } }
|