Task 1: Reflection

The Vehicle Sales Data dataset provides an overview of vehicle sales (used) across different manufacturers, models, and regions. It includes key variables such as selling price, vehicle make and model, condition of the cars sold, odometer readings, and Manheim Market Report (MMR) values. Such datasets are valuable for understanding market trends, consumer preferences, and the factors influencing used vehicle sales across various geographical areas.

With the data analysis on this dataset, insights can be drawn about how the selling price odometer and conditions of the cars sold are related. Additionally, the data could aid in competitive analysis by identifying market leaders, better-selling car models, and emerging trends. With the right tools, this dataset allows for understanding customer preferences in used cars and developing business strategies in the automotive industry, making it a useful resource for market analysts, business owners, and policymakers.

Task 2: Interactive plots

library(tidyverse)
library(plotly)

# Loading the Vehicle Sales data
vehicle_sales_df <- read_csv("car_prices.csv")

# Dealing with NAs in the dataset
vehicle_sales_df <- na.omit(vehicle_sales_df)

# Filtering data for only 2015 data
vehicle_2015_df <- vehicle_sales_df %>% filter(year == 2015)

Do the following:

  1. Make a plot. Any kind of plot will do (though it might be easiest to work with geom_point()).

  2. Make the plot interactive with ggplotly().

  3. Make sure the hovering tooltip is more informative than the default.

Good luck and have fun!

# Scatterplot between odometer reading and selling price of used vehicles in 2015

plot1 <- ggplot(vehicle_2015_df, aes(odometer, sellingprice, color=transmission)) +
                  geom_point (aes(text=transmission)) +
                   labs(title = "Relationship between Odometer reading & Selling price of cars",
                     x = "Odometer Reading", 
                     y = "Selling Price",
                     caption = "Used Vehicle Sales Data (Kaggle) - 2015", color="Transmission") +
                  theme_minimal()

ggplotly (plot1, tooltip = "text")