Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

use R as coding language and answer asap

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mathematics In Middle And Secondary School A Problem Solving Approach

Authors: Alexander Karp, Nicholas Wasserman

1st Edition

1623968143, 9781623968144

More Books

Students also viewed these Mathematics questions

Question

What are the pros and cons of credit? Critical T hinking

Answered: 1 week ago