Question: use R as coding language and answer asap D The following information is used in questions 8-11. The count nas ( ) function inputs a

 use R as coding language and answer asap D The following

use R as coding language and answer asap

information is used in questions 8-11. The count nas ( ) function

D The following information is used in questions 8-11. The count nas ( ) function inputs a vector x and outputs the number of NAS (including NaN, if applicable) in x. count_nas count_nas (character (0) ) [1] 0 > count_nas (c (1, NA, 3, NA, NaN, 8) ) [1] 3 > count_nas (NA) [1] 1 > count_nas (1:10) [1] 0 Question 11 3 pts Using your fixed count_nas () function, write a function called count_nas_mat () that inputs a matrix and outputs a numeric vector with the number of NAs in each column. For example: > x mat x mat [,1] [, 2] [, 3] [1, ] NA 1 NA [2, ] NA 0 4 [3, ] 2 3 5 > count nas mat (x mat) [1] 2 0 1 Note: You can assume a working version of count_nas () , even if you do not write one yourself in the previous

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 Mathematics Questions!