Lahman's Batting Data for 2014

Description

2014 Batting statistics from Sean Lahman's baseball statistics database (released under CC BY-SA 3.0 license).

Usage

1

Format

A data frame with 1435 rows and 22 variables

Details

  • playerID Player ID code

  • yearID Year

  • stint player's stint (order of appearances within a season)

  • teamID Team; a factor

  • lgID League; a factor with levels AA AL FL NL PL UA

  • G Games: number of games in which a player played

  • AB At Bats

  • R Runs

  • H Hits: times reached base because of a batted, fair ball without error by the defense

  • X2B Doubles: hits on which the batter reached second base safely

  • X3B Triples: hits on which the batter reached third base safely

  • HR Homeruns

  • RBI Runs Batted In

  • SB Stolen Bases

  • CS Caught Stealing

  • BB Base on Balls

  • SO Strikeouts

  • IBB Intentional walks

  • HBP Hit by pitch

  • SH Sacrifice hits

  • SF Sacrifice flies

  • GIDP Grounded into double plays

Source

Lahman, S. (2015) Lahman's Baseball Database, 1871-2014, 2015 version, http://baseball1.com/statistics/.

Examples

 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
## Not run: 
library(lattice)

vdbConn(tempfile(), autoYes = TRUE)

# make "splod" directly from a data frame
splod(batting, name = "batting",
  id.vars = c("playerID", "yearID", "stint", "teamID", "lgID"))

# first transform the data into a "splodDat" object
batSplodDat <- makeSplodData(batting,
  id.vars = c("playerID", "yearID", "stint", "teamID", "lgID"))
# now make "splod"
splod(batSplodDat, name = "batting2", data = batSplodDat)

# custom panel function (color by league)
mySplodFn <- function(d) {
  xyplot(jitter(y) ~ jitter(x), groups = lgID, data = d,
    xlab = getSplitVar(d, "xVar"),
    ylab = getSplitVar(d, "yVar"),
    auto.key = TRUE
  )
}

splod(batSplodDat, name = "batting3",
  data = batSplodDat, panelFn = mySplodFn)

view()

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.