# Load necessary packages
library(ggplot2)
library(gsheet)
library(plotly)
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
# Import data
ranking <- gsheet2tbl("https://docs.google.com/spreadsheets/d/1Ap5h86minzUi-wOqE9SREHGCa_nGTDPspa7V5WFDnEI/edit#gid=408435445")
## No encoding supplied: defaulting to UTF-8.
NAMES <- c("Date", "Name", "Time", "Experience",
"Controller", "Course", "CC", "Items Used",
"Character", "Coins", "Switch", "Place")
names(ranking) <- NAMES
# Scatterplot aesthetics
p <- ggplot(ranking, aes(x = Time, y = CC, color = Course)) +
geom_point(size = 3) + # Default size
scale_color_manual(values = c("#1f77b4", "#ff7f0e", "#2ca02c", "#d62728"), name = "Course") + # More colors for each course
labs(x = "Time", y = "CC") +
theme_minimal()
# Convert to interactive plot
ggplotly(p)
# Scatterplot aesthetics
p <- ggplot(ranking, aes(x = CC, y = Time, color = Course)) +
geom_point(size = 3) + # Default size
scale_color_manual(values = c("#1f77b4", "#ff7f0e", "#2ca02c", "#d62728"), name = "Course") + # More colors for each course
labs(x = "CC", y = "Time") +
theme_minimal()
# Convert to interactive plot
ggplotly(p)