This data is about the top 100 Women’s Singles Tennis scores. I will be utilizing it to create a quick visualization.
library("readr")
tennis <-read_csv("top100tennis_clean.csv")
## Parsed with column specification:
## cols(
## rank = col_double(),
## country = col_character(),
## player = col_character(),
## last_name = col_character(),
## first_name = col_character(),
## age = col_double(),
## points = col_double(),
## tourn.played = col_double()
## )
I will be using functions from the dply, ggplot2, and plotly libraries. It can be installed with install.packages() if it is not already on the device.
library(dplyr)
## Warning: package 'dplyr' was built under R version 3.6.1
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(ggplot2)
library(plotly)
## Warning: package 'plotly' was built under R version 3.6.1
##
## 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
For this visualization, I used ggplot and ggplotly. The age of the players is represented on the x-axis, and the total points scored by each player is represened by the y-axis.
chart2 <- tennis %>% ggplot(aes(x = age, y = points, size = points, text = paste("Country:", country))) +
theme_minimal(base_size = 12) +
geom_point(alpha = 0.8, color = "hotpink") +
ggtitle("Women's Singles Tennis Players") +
xlab("Age") +
ylab("Total Points") +
theme_minimal()
chart2 <- ggplotly(chart2)
chart2