Question: These are the questions I need to do for Computing (intro to R) course. 1. The apply() function is an alternative to loop and is

 These are the questions I need to do for Computing (intro

These are the questions I need to do for Computing (intro to R) course.

1. The apply() function is an alternative to loop and is populated with functions to ma- nipulate slices of data from matrices, arrays, lists and data frames in a repetitive way. Take a look at the help page of apply() and decide which of the following statements are True and which are False. (a) (5 points) True or False: apply() family is in the R base package, so we don't need to install any packages to use this function. (b) (5 points) True or False: apply(X, 2, sum) calculate the sum value of the matrix X along margin 2, so it add up the values of each row of X. (c) (5 points) True or False: In apply(), we are not able to apply a function on each cell. (d) (5 points) True or False: If my.matrix is a 3*10 matrix, apply(my.matrix, 2, function (x) length(x)-1) will return rep(2,10)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!