1. Use R to answer the following questions. Before beginning, load the necessary data sets by
entering the following commands:
> data(iris)
> data(islands)
> data(mtcars)
Directions for problem 1: When I ask you below “what type of object is ______”, answer with
one of the following:
vector, factor, matrix, data frame, list, or function
Be as specific as possible; for example, all matrices are arrays, but not all arrays are matrices.
So, if ______ is in fact a matrix, calling it an array is not a full credit answer. Also, a data frame
is a special case of a list, so if ________ is a data frame, calling it a list is not a full credit answer.
Note: If ________ is a vector or matrix, give me the data storage mode also, as specifically as
possible (“numeric” is not specific enough). Finally, tell me in each case how you reached your
answer i.e. if you used R commands, looked at the object onscreen, etc.
Two points each.
a. What type of object is iris ?
b. What type of object is the column named Species in the data set iris?
c. What type of object is islands ?
d. What place is measured in the 19th component of islands?
e. What type of object is the row names of the mtcars data?
Stat 540 Hwk 1 p.1
2. For each part below, give a single R command to accomplish the goal. Two points each.
a. Create a regularly spaced sequence of values between 0 and 10, by increments of 0.2. Do
not use the c() function.
b. Create a regularly spaced sequence from - to , of length 10. Do not type in the numerical
value of – use a built-in trig function or built-in value to create it – this will give doubleprecision accuracy. Do not use the c() function.
c. In the islands object, New Zealand appears twice – the Northern island and the Southern
island. Give a single command to calculate the total area of both islands taken together.
d. Obtain the 5-number summary for mpg in the mtcars data frame with one command.
e. Find the standard deviation of Sepal Lengths for the iris species setosa with one command.
3. (7) Make a well-labeled histogram of the Sepal lengths of the iris setosa species. Use your
favorite color for the bars. By well-labeled, I mean follow the guidelines of the handout
discussed in class. Paste your graph into your solutions. Hint: help(iris)
4. (8) For the iris data, construct side-by-side boxplots of the Sepal lengths for the three species.
Label the plot appropriately for a formal report. Hint: read the help file for boxplot.
Stat 540 Hwk 1 p.2
Essay Writing Service Features
Our Experience
No matter how complex your assignment is, we can find the right professional for your specific task. Achiever Papers is an essay writing company that hires only the smartest minds to help you with your projects. Our expertise allows us to provide students with high-quality academic writing, editing & proofreading services.Free Features
Free revision policy
$10Free bibliography & reference
$8Free title page
$8Free formatting
$8How Our Dissertation Writing Service Works
First, you will need to complete an order form. It's not difficult but, if anything is unclear, you may always chat with us so that we can guide you through it. On the order form, you will need to include some basic information concerning your order: subject, topic, number of pages, etc. We also encourage our clients to upload any relevant information or sources that will help.
Complete the order form
Once we have all the information and instructions that we need, we select the most suitable writer for your assignment. While everything seems to be clear, the writer, who has complete knowledge of the subject, may need clarification from you. It is at that point that you would receive a call or email from us.
Writer’s assignment
As soon as the writer has finished, it will be delivered both to the website and to your email address so that you will not miss it. If your deadline is close at hand, we will place a call to you to make sure that you receive the paper on time.
Completing the order and download