R uses many types to brackets for different purposes and it is initially challenging to differentiate between specific uses.
These questions draw from information gained in Analyzing Patient Data and Creating Functions
If x <- c(1,3,6,34,2,3,5,76,3,4,5,6,7,9)
which answer below will create a custom function that will calculate the mean of the first "y" numbers?
mean_first_y <- function(X,Y){mean(x[1:Y])}
mean_first_y <- function(X,Y)(mean(x[1:Y]))
mean_first_y <- function(X,Y)mean(x[1:Y])
If x <- c(1,3,6,34,2,3,5,76,3,4,5,6,7,9)
which answer below will calculate the mean of the first 3 numbers in x?
mean[x[1:3]]
mean{x[1:3]}
mean(x{1:3})
mean(x[1:3])
mean(x{1:3})
For question 2, the distractors are:
()
()
[]
mean(x[1:3])
is the correct answer[]