Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you please help me with this using R : provide a custom function called irisColor(). Your function should take in a single character string

Can you please help me with this using R : provide a custom function called irisColor(). Your function should take in a single character string as the only input. If the input is "setosa", retu Can you please help me with this using R please: Home 1. provide a custom function called irisColorl). Your function should take in a single character string as the only input. If the input is "setosa", return "red" If the input is "versicolor", return "lightblue" o If the input is "virginica", return "purple" If the input is not one of the above, throw an informative error 2. Use sapply() and your custom function to produce an array of length 150 that has these three colors by species for the 150 specimens in the iris data set. 3. Plot petal width (Y) against petal length (X), using a scatterplot. Make your plot useful by giving it appropriate labels. The main title of the plot should be your name. Additionally, use a solid plotting mark (like pch=20) and color them by species via giving col= your array from b)

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

Algebra And Trigonometry Enhanced With Graphing Utilities

Authors: Michael Sullivan, Michael Sullivan III

7th Edition

0134269039, 9780134269030

More Books

Students also viewed these Mathematics questions

Question

Values: What is important to me?

Answered: 1 week ago