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

R Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

R Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it