Which of the following R code can be used to avoid numeric problems such as taking the logarithm of a negative number?

Which of the following R code can be used to avoid numeric problems such as taking the logarithm of a negative number? Correct Answer if( any(x <= 0) ) y <- log(1+x) else y <- log(x)

Related Questions