Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In R Programming please help me fulfill the code for problem 7 a-d 7. Define the following functions: a. A function funcSum that accepts a
In R Programming please help me fulfill the code for problem 7 a-d
7. Define the following functions: a. A function funcSum that accepts a numeric vector and returns the sum of the elements. Assume input will not have missing values, special values, and at least one element. A function funcIsPrime that accepts a numeric scalar (vector of length one) and returns TRUE is the input is a prime number and FALSE otherwise. Assume input will not have missing values, special values, and at least one element. A function funcCountNA that accepts a vector and returns the number of missing values (NAs) found in the vector. A function funcCountDENA that accepts two arguments: x, a data frame; and an option parameter count mode (default-1). If count_mode equals 1, then the function should return the total number of missing values in the entire input data b. c. d. frame; if count_mode equals 2, then the function should return the number of rows in which there is at least one missing value in the input data frame; if count_mode equals 3, then the function should return the number of columns in which there is at least one missing value in the input data frame. If x is not a data frame or is count_mode is not in the set {1, 2, 3), the function should return a NULL Hint: See help on length; sum; is.na; is.data.frameStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started