Question: #2. Dataframes. Recall that if the data is included in R, you can simply type the name of the dataset to use it. For example,

 \#2. Dataframes. Recall that if the data is included in R,

\#2. Dataframes. Recall that if the data is included in R, you can simply type the name of the dataset to use it. For example, the first 6 lines of the 'iris' dataset can displayed using the code: {r} head(iris, 6) a. Change the above code to display the first 3 lines of the iris dataset. Also google (or guess) to find out how to display the last 3 lines of the dataset. b. Use the $ notation to extract the Sepal Length column of iris. Then use ordinary vector indexing to extract 12 th through 17 th entries of that column. ".." {r} c. Look up (Google, or Stack Overflow. ..) the 'unique' command in R. Use it to determine how many unique species are represented in the iris dataset ( 1 understand that you can just look at the dataset in this case-don't do that this way.) d. What is the largest Petal Length in the data set? What is the smallest? What is the average Petal Length? Can you find an R command to determine which species these correspond to? " {r}3 e. Try using the 'which' command to determine the irises in this dataset which have a Petal Length larger than 5 . Create a dataframe which contains only such irises. Which species do these largely correspond to? {r} f. Use an R command to find irises which have a petal length larger than 5 OR a petal length smaller than 1.5. Which species do these correspond to? g. Are there any irises with petal length than 5 and petal width larger than 2.4 ? If so, what are they

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!