1.

Which of the following finds row sums for each level of a grouping variable?(a) rowSums (x, na.rm = FALSE, dims = 1)(b) colMeans(x, na.rm = FALSE, dims = 1)(c) rowMeans(x, na.rm = FALSE, dims = 1)(d) rowsum(x, group, reorder = TRUE, …)The question was posed to me during a job interview.My enquiry is from Commands in chapter Commands, Packages, Visualizing Data and Linear Regression of R Programming

Answer»

The correct ANSWER is (c) rowMeans(X, na.rm = FALSE, dims = 1)

The EXPLANATION is: False value leads to unexpected result.



Discussion

No Comment Found

Related InterviewSolutions