In this exercise, you will work with rivers data. The data pertain to the length of major North American rivers, and it is built-in data in R. You can access the data by typing:
Your task is to build a function that returns descriptive statistics for different inputs. The function is named descriptive_function and has three arguments (i.e., another name of inputs).
descriptive_function(list, char, num)
The requirements of the function are as follows:
· The function has three arguments. The first argument is a list of numbers in doubles. The second argument is a character, and the last argument is a number.
· If char is ‘m ’, the function prints the arithmetic mean of the list.
· If char is ‘v’, the function prints the variance of the list.
· If char is ‘s’, the function prints the standard deviation of the list.
· If char is ‘z’, the function prints the z-score of num with respect to the list.
· You can use built-in R functions including mean(), var() and sd().
Sample test cases:
> descriptive_function(rivers, ‘m’, 7)
> descriptive_function(rivers, ‘m’)
> descriptive_function(rivers, ‘s’)
> descriptive_function(rivers, ‘v’, 8)
> descriptive_function(rivers, ‘z’, 8)
It's no longer good enough to create a high-quality product at a reasonable cost.
That is why we have created 9 compelling warranties to make your usage of our service pleasant, simple, and secure.
You must be completely confident in the quality of your products in order to provide a money-back guarantee. This is precisely how custom paper writing services work. We double-check that there are no hidden issues with this promise and that you are completely happy with the quality of your purchase.Read more
Our writers do not employ others’ writing tricks, because we are aware that plagiarism may cost a lot to our clients and take away their reputation.Read more
We want you to be satisfied with your order, so we offer a free revision policy. If you are not completely happy with your order, let us know and we will revise it for free.Read more
We care about our customers and always strive to keep their trust. That’s why Customwritingspapers.com guarantees privacy and safety of your personal information. To ensure total security, we take the following measures:Read more
Our team of editors works tirelessly to ensure that all papers meet our high standards for quality. They check for the instructions, grammar, punctuation, and spelling mistakes as well as for plagiarism.Read more
We would never want to jeopardize our relationship with you, and that is why we offer a fair-cooperation guarantee: If for any reason you are not satisfied with your order, you can always get your money back.Read more
We only hire the best, most qualified professionals to work on your order. Each writer is a degree holder with extensive experience in their field. You can be assured that your project will be handled by a true expert.Read more
Our quality assurance department ensures that each paper is of excellent quality before it is sent to you. You can be sure that your paper will meet all of the requirements that you set. Our experts are highly skilled and will follow your specific instructions to the letter.Read more
We have a highly professional and qualified customer support team that is available 24/24, 365 days a year. They will be more than happy to answer any questions or concerns that you may have about our company or products. You can contact them by phone, email, or chat on our website.Read more