1.

Which of the following truncates real x to integers?(a) as.order(x)(b) as.integer(x)(c) as.numeric(x)(d) as.character(x)I have been asked this question in an interview for internship.The origin of the question is Commands topic in chapter Commands, Packages, Visualizing Data and Linear Regression of R Programming

Answer» CORRECT OPTION is (b) as.INTEGER(x)

To elaborate: as.integer for object of class truncates decimal part of image VALUES and then CONVERTS to type integer.


Discussion

No Comment Found

Related InterviewSolutions