# Run this code to load the required packages
suppressMessages(suppressWarnings(suppressPackageStartupMessages({
library(mosaic)
library(supernova)
library(fivethirtyeight)
})))
nbaplayers <- read.csv("https://docs.google.com/spreadsheets/d/e/2PACX-1vSWOzObVF0AHcXHCxZepTDtTjhpIE4PkrrlnxK67XVxuOwt8iSqz9G-VQKwez54xZfXhYe1Yj5PlA0-/pub?gid=2123483031&single=true&output=csv", head = TRUE)
head(nbaplayers)
mean(nbaplayers$height)
str(nbaplayers)
summary(nbaplayers)
net_rating <- nbaplayers$net_rating
hist(net_rating)
height <- nbaplayers$height
hist(height)
weight_pounds <- nbaplayers$weight * 2.204
hist(weight_pounds)
head(arrange(nbaplayers, (net_rating)))
head(arrange(nbaplayers, desc(pts)))
plot(nbaplayers$pts, nbaplayers$net_rating, main = "Scatterplot of player pts by net rating", xlab = "pts", ylab = 'net_rating')
colleges <- c("Harvard" , "Stanford", "Princeton", "MIT", "Yale")
filter(nbaplayers, college == colleges))
top5_colleges <- filter(nbaplayers, college == colleges)
tally(unique(top5_colleges$player_name))
length(unique(top5_colleges$player_name))
head(nbaplayers$height, 10)
short_10 <- filter(arrange(nbaplayers, desc(height)))
shortest_names <- tail(unique(short_10$player_name), 10)
shortest_names
truncate <- select(short_10, player_name, height)
unique_truncate <- unique(truncate)
tail(unique_truncate, 10)
head(unique_truncate, 10)
height <- nbaplayers$height
hist(height)
plot(nbaplayers$height, nbaplayers$net_rating, main = "Scatterplot of player height by net rating", xlab = "height", ylab = 'net_rating')