Car_Data <- read_csv("https://myxavier-my.sharepoint.com/:x:/g/personal/pennellim_xavier_edu/EQZflulpzLNNrSF_-pSHrjEBwBuBaQxkMhvL_ugYKcSMPA?download=1")Car Data
Introduction
My data has information on Cars that are from India. The price is in rupees since that is their currency. It has other attributes such as horsepower and body type of vehicle. Each row is a different car. Each column is an attribute describing that specific car.
Research Question
Do SUV or sedans have a higher average starting price and by how much?
From this information I can know what to expect for prices when getting a car. I may want to buy SUV’s if they are a lot cheaper on average. I will have to use the variables body type and starting price body type will be on the x axis and price on the y. I will filter the x axis since I only want to see sedan and SUV. I can then convert the price to dollars since its in rupees. Then I will average the price for both SUV and sedan. A bar graph should be good since its 1 discrete variable and 1 continuous.
Car_Data %>%
filter(body_type %in% c("SUV", "Sedan"))%>%
mutate(starting_price_USA = starting_price * .012)%>%
ggplot(aes(x = body_type, y = starting_price_USA)) +
geom_bar(stat = "summary", fun = mean) +
labs(title = "Average Price of Sedan and SUV",
x = "Body Type",
y = "Average Price")+
scale_y_continuous(labels = scales::dollar)Explanation of graph
Looking at the graph it seems Sedans are slightly more than SUV’s on average. You can tell that these are high end cars though as they are both slightly over 100,000 dollars for an average price.
1 + 1[1] 2
You can add options to executable code like this
[1] 4
The echo: false option disables the printing of code (only output is displayed).