BZAN4397 Programming for Bus Analytics
Need help with this assignment?Get an original answer from a qualified tutor — from $10/page.
Get it written →
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.
Get a plagiarism-free answer to this question
Send us your instructions and we’ll match you with the best writer in your subject.
- 100% human-written, zero AI
- Turnitin report included
- Confidential — we never share your data
- Free revisions & refunds
