-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParCoordsTest.R
More file actions
31 lines (26 loc) · 825 Bytes
/
ParCoordsTest.R
File metadata and controls
31 lines (26 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
library(tidyverse)
library(Lahman)
library(plotly)
batting <- Batting
batting %>%
filter(yearID == 2016) %>%
plot_ly() %>%
add_trace(
type = 'parcoords',
line = list(
color = ~G,
showscal = TRUE
),
dimensions = list(
list(range = c(~min(G, na.rm =T), ~max(G, na.rm =T)),
label = 'Games Played', values = ~G),
list(range = c(~min(AB, na.rm =T), ~max(AB, na.rm =T)),
label = 'At-Bats', values = ~AB),
list(range = c(~min(H, na.rm =T), ~max(H, na.rm =T)),
label = 'Hits', values = ~H),
list(range = c(~min(RBI, na.rm =T), ~max(RBI, na.rm =T)),
label = 'RBI', values = ~RBI),
list(range = c(~min(HR, na.rm =T), ~max(HR, na.rm =T)),
label = 'HR', values = ~HR)
)
)