Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use R for coding The following information is used in the next two questions. The iris data in the datasets package is a famous data

use R for coding

image text in transcribed
The following information is used in the next two questions. The iris data in the datasets package is a famous data set that gives the measurements (in centimeters) of the variables sepal length, sepal width, petal length, and petal width, respectively, for 50 flowers from each of 3 species of iris. The species are Iris setosa, versicolor, and virginica. Consider the following working code and output: > str(iris) data . frame' : 150 obs. of 5 variables: $ Sepal . Length: num 5.1 4. 9 4.7 4. 6 5 5. 4 4. 6 5 4. 4 4.9 .. . $ Sepal. Width : num 3.5 3 3.2 3.1 3.6 3. 9 3. 4 3. 4 2. 9 3. 1 . . . $ Petal. Length: num 1. 4 1.4 1.3 1.5 1.4 1. 7 1. 4 1. 5 1. 4 1. 5 . .. $ Petal. Width : num 0.2 0.2 0.2 0.2 0.2 0.4 0. 3 0.2 0.2 0. 1 $ Species : Factor w/ 3 levels "setosa", "versicolor",. .: 1111111111... numeric_vars numeric_vars [1] "Sepal. Length" "Sepal. Width" "Petal. Length" "Petal.Width" output Question 10 3 pts Write a simpler version of the given code without loops that computes the same output. The output object should be identical. Hint: The computation can be done with a single command

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

Calculus With Applications, Version

Authors: Margaret L Lial, Raymond N Greenwell, Nathan P Ritchey

10th Edition

032183111X, 9780321831118

More Books

Students also viewed these Mathematics questions

Question

Go, do not wait until I come

Answered: 1 week ago