Show Code
# Load data from Google Drive
url <- "https://drive.google.com/uc?id=1W9UYyKDAV3UZWPppYs7N8R9ne5ws5iZ3&export=download"
data <- read.csv(url)

# Filter data for selected manufacturers
selected_manufacturers <- c("Apple", "Nokia", "Samsung")
filtered_data <- data %>%
  filter(Manufacturer %in% selected_manufacturers)

# Convert 'Year' column to numeric
filtered_data$Year <- as.numeric(as.character(filtered_data$Year))
# Aggregate data by manufacturer, smartphone status, and form factor
aggregated_data <- filtered_data %>%
  group_by(Manufacturer, Smartphone., Form.Factor) %>%
  summarise(Total_Units_Sold = sum(UnitsSold), .groups = 'drop')

# Convert 'Smartphone.' column to factor for better display
aggregated_data$Smartphone. <- factor(aggregated_data$Smartphone., labels = c("Non-Smartphone", "Smartphone"))
# Display the interactive plot
fig