Correct Answer: for ( i in 1:nrow(df) ) print( mean( as.numeric( df[ i , ] ) ) )
Explanation:
Note: This Question is unanswered, help us to find answer for this one
R Skill Assessment
Your Skill Level: Poor
Retake Quizzes to improve it
More R MCQ Questions
Given x <- c(1:3,NA), the command: (x+1)[(!is.na(x)) & x>0] -> z generates:
Which class avoids making copies of objects?
What is the output of matrix(1:10, nrow=2)[2,2]?
Which R function fits a simple linear regression model of x predicting y without an intercept?
What's the output of the command : x <- c(T, T, NA); all(x, na.rm = TRUE)
What is the output of the following calculation? t(c(1, 1)) %*% c(1, 1)
Suppose we have defined a list object, "X", which has 3 components. Each component is a vector with at least 5 elements. Which command will extract the fourth (4th) element from the third (3rd) component of our list?
matrix(1:4, ncol = 2)[1,]
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?
The command > t( matrix( 3:2, nrow=2 ) ) will generate:
R MCQs | Topic-wise