BZAN4397 Programming for Bus Analytics
Provide your code in the R file. Remember to save the file with all your answers and submit it# Exam 2 coding questions
# Date :
# Name :
#install.packages(“ggplot2”)
library(ggplot2)
df<- mtcars
#1. draw a scatter plot, with x-axis being the wt, and y-axis being the mpg. Please name the scatter plot “Scatter Plot of Wt vs Mpg”. You may use either plot or ggplot function.
#2. draw a histogram of mpg, with binwidth of 5, fill is red.
#3. draw a boxplot titled”Mpg n according to the number of cylinder”; x-axis is the wt, and y-axis is the mpg.Use the facet_grid function to form matrix of panels of cyl.
#4. draw a scatter plot, with x-axis being the mpg, and y-axis being the wt, and color being the cyl. The point size is 5.
#5. download the csv file “heart.csv” into the same folder as the R file, and assign it to hd, set the working directory to the source file location.
#Create a scatterplot of biking and heart disease using ggplot.
attach(diamonds)
#6. draw a boxplot of “Color Diamond Price”, with x-asix being the color, y asix being the price. The fill color of the boxplot is blue
#7. draw a scatter plot of price vs carat.
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.