A

Admin • 833.24K Points
Coach

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

  • (A) if( any(x < 0) ) y <- log(1+x) else y <- log(x)
  • (B) if( any(x <= 0) ) y <- log(1+x) else y <- log(x)
  • (C) if( any(x >= 0) ) y <- log(1+x) else y <- log(x)
  • (D) if( any(x >> 0) ) x >- log(1+x) else x <- log(x)
  • Correct Answer - Option(B)
  • Views: 21
  • Filed under category R Programming
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.