1

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)

Make the most of this question

This page focuses on one R Programming MCQs question from Programming. After checking the answer, return to the topic list to practice more or run a timed set.

R Programming MCQs MCQ: Which of the following R code can be used to avoid numeric problems such as taking the logarithm of a negative number? | Extra Education