1.

Which of the following statement applies the function (FUN) to either rows (1) or columns (2) on object X?(a) apply(x,1,min)(b) apply(x,2,max)(c) col.max(x)(d) apply(X, MARGIN, FUN, …)I have been asked this question in quiz.This intriguing question comes from Commands in portion Commands, Packages, Visualizing Data and Linear Regression of R Programming

Answer»

Correct option is (d) apply(X, MARGIN, FUN, …)

To explain I would say: apply(x,2,max) finds the MAXIMUM for each COLUMN.



Discussion

No Comment Found

Related InterviewSolutions