1.

What will be the output of log (-5.8) when executed on R console?(a) NAN(b) NA(c) Error(d) 0.213This question was addressed to me in an internship interview.I want to ask this question from Functions in section Control Structures, Functions, Scoping Rules, Loop Functions and Debugging of R Programming

Answer»

Right choice is (a) NAN

Explanation: EXECUTING the above on R console or terminal will display a WARNING SIGN that NaN (Not a NUMBER)will be PRODUCED in R console because it is not possible to take a log of a negative number(-).



Discussion

No Comment Found

Related InterviewSolutions