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, …)

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