Using vectors and objects
In this exercise, we will study two datasets that are shipped with the ggplot2 package: diamonds – describing the prices of more than 50,000 cut diamonds and msleep – describing the sleep times of 83 mammals. To install the package from CRAN, you can either select Tools > Install packages in the RStudio menu and then write ggplot2 in the text box in the pop-up window that appears, or use the following line of code: install.packages(“ggplot2”)
Provide in the plain text R commands that finds/solves the problems below:
1. View the documentation for the diamonds data and read about different variables. Check the data structures and answer:
a. how many observations and variables are there and what type of variables (numeric, categorical, etc.) are there?
b. Compute summary statistics (means, median, min, max, counts for categorical variables).
c. Are there any missing values?
2. Create a scatterplot with total sleeping time along the x-axis and time awake along the y-axis (using the msleep data).
a. What pattern do you see?
b. Explain the pattern(s).
c. Explain the correlation between total sleeping time and time awake.
Dates and times in R – https://www.stat.berkeley.edu/~s133/dates.html
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.