Introduction

The 2008 Season Offensive Production

library(plotly)
## Warning: package 'plotly' was built under R version 3.3.3
## Loading required package: ggplot2
## 
## 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
ostat <- read.csv("MLB2008.csv")
plot_ly(ostat, x = ostat$SALARY, y = ostat$AVG, z = ostat$POS, type = "scatter3d", mode = "markers", color = ostat$POS) %>%
layout(scene = list(
           xaxis = list(title = "Salary ($)"), 
           yaxis = list(title = "Batting Average"), 
           zaxis = list(title = "Position")))
## Warning in arrange_impl(.data, dots): '.Random.seed' is not an integer
## vector but of type 'NULL', so ignored