MCQs>Finance & Management>R>Which is the fastest way to calculate groupwise means of a variable "x" for each level of a factor called "factor", given you have installed base R, data.table, and plyr?
R MCQs
Which is the fastest way to calculate groupwise means of a variable "x" for each level of a factor called "factor", given you have installed base R, data.table, and plyr?
Answer
Correct Answer: df[ ,mean(x), by = factor ]
Explanation:
Note: This Question is unanswered, help us to find answer for this one