. Write a short R function called missingMaxMin that accepts two paramters: a. b. A vector...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
. Write a short R function called missingMaxMin that accepts two paramters: a. b. A vector of numbers called InputNumbers, some of which may be missing (i.e. NA) An indicator variable MaxMin which has a value of either 1 or 2 i. If MaxMin is 1, missing values in InputNumbers are replaced with the maximum value in InputNumbers ii. If MaxMin is 2, missing values in inputNumbers are replaced with the minimum value in InputNumbers So for instance x <-c(1.2, 7.9, 3.4, NA, 4.2, 9.1, NA) z <- missingMaxMin(x, 1) z would now contain (1.2, 7.9, 3.4, 9.1, 4.2, 9.1, 9.1) hint remember to use the na.rm-T parameter . Write a short R function called missingMaxMin that accepts two paramters: a. b. A vector of numbers called InputNumbers, some of which may be missing (i.e. NA) An indicator variable MaxMin which has a value of either 1 or 2 i. If MaxMin is 1, missing values in InputNumbers are replaced with the maximum value in InputNumbers ii. If MaxMin is 2, missing values in inputNumbers are replaced with the minimum value in InputNumbers So for instance x <-c(1.2, 7.9, 3.4, NA, 4.2, 9.1, NA) z <- missingMaxMin(x, 1) z would now contain (1.2, 7.9, 3.4, 9.1, 4.2, 9.1, 9.1) hint remember to use the na.rm-T parameter
Expert Answer:
Related Book For
Numerical Methods With Chemical Engineering Applications
ISBN: 9781107135116
1st Edition
Authors: Kevin D. Dorfman, Prodromos Daoutidis
Posted Date:
Students also viewed these operating system questions
-
Consider the region R bounded by the graphs of y = (x) > 0, x = a > 0, x = b > a, and y = 0 (see accompanying figure). If the volume of the solid formed by revolving R about the x-axis is 4, and the...
-
Show that the shortest curve that has an area \(A\) below it is a circular arc, \[ (\lambda x-c)^{2}+(\lambda y-d)^{2}=1, \] as shown in Fig. 14.9. Here \(\lambda\) is a Lagrange multiplier constant...
-
Several industries located along the Ohio River discharge a toxic substance called carbon tetrachloride into the river. The state Environmental Protection Agency monitors the amount of carbon...
-
Ask friends, relatives, and others about their short-term and long-term financial goals. What are some of the common goals for various personal situations? Using Sheet 3 in the Personal Financial...
-
A gas in a rigid vessel is at ambient temperature and at a pressure, P1, slightly higher than ambient pressure, P0. A valve on the vessel is opened, so gas escapes and the pressure drops quickly to...
-
Throughout the US presidential election of 2016, polls gave regular updates on the sample proportion supporting each candidate and the margin of error for the estimates. This attempt to predict the...
-
Information concerning Montana Company is provided in BE19-16. What are the total product costs for the company under absorption costing?
-
Madox Max Ltd pay a dividend of $3.3 per share next year. After that the dividend is forecast to grow at 15% for 1 year. From year three onwards dividends are expected to grow by 6% indefinitely....
-
When measuring small pressure differences with a manometer, often one arm of the manometer is inclined to improve the accuracy of reading. (The pressure difference is still proportional to the...
-
What is (Fot 3) the x-component of the net force exerted by these two charges on a third charge 93 = 45.5 nC placed between and 92 at 3 = -1.145 m? Your answer may be positive or negative, depending...
-
Who should determine Medicaid provider reimbursement rates, and how should they compare to other insurance programs or plans? Should the federal government play a stronger role in setting provider...
-
Some people argue that the government should not intervene in the case of a market failure because the government itself is inefficient and will simply create new problems to replace the ones it is...
-
What are the benefits and drawbacks of having a health program that varies by state versus having one that is uniform across the country? Do you find that the positives of state flexibility outweigh...
-
What do you think about the role and success of tort law in promoting high-quality health care? Does it help to deter errors? If not, why?
-
Do you think it makes more sense to structure government healthcare programs as entitlements or block grants? What are the economic and healthcare risks and benefits of each approach? Does your...
-
Which of the following is/are an example/s of ingredient branding? Select one: a. Both Bajaj V5 and Fitoor are examples of ingredient branding. b. The Bollywood film Fitoor starring Katrina Kaif and...
-
What can scientists learn by comparing the fossilized skeletons of extinct primates with the bones of modern species?
-
What are the entries of the matrix produced by the following code: 1 2 3 4 5 for i = 1:3 for end end j = 1:1 A(i, j) = i*j;
-
Consider the partial differential equation subject to the constant concentration boundary condition c(0, t) = 0 and the reactiondiffusion boundary condition and the initial condition c(x, 0) = 1. The...
-
Compute the L 1 , L 2 , and L norms for the vector x = [10 3 4 1 5].
-
For fluids with \(\operatorname{Pr} <1\) the velocity profile is assumed to be a cubic for \(y
-
Consider the flat-plate heat transfer to be solved by the similarity approach. Show all the details leading to Eq. (18.15). What are the boundary conditions on \(\theta\) ? Extend your MATLAB code to...
-
Show all the steps leading to the integral balance equation (18.6) in the text. Use the following boundary conditions and verify Eq. (18.7). (i) At \(y=0, T=T_{\mathrm{S}}\). (ii) At...
Study smarter with the SolutionInn App