MyNixOS website logo
Description

Import Professional Baseball Data from 'Retrosheet'.

A collection of tools to import and structure the (currently) single-season event, game-log, roster, and schedule data available from <https://www.retrosheet.org>. In particular, the event (a.k.a. play-by-play) files can be especially difficult to parse. This package does the parsing on those files, returning the requested data in the most practical R structure to use for sabermetric or other analyses.

retrosheet

R-CMD-check CRAN_Status_Badge License: GPL2.0 GitHubcommit Downloads

Import Retrosheet data as a structured R object

retrosheet is an R package that downloads and parses the single-season event, gamelog, roster, and schedule files from retrosheet.org into structured R objects for further analysis.

Note: As of retrosheet 1.1.0, this repo contains the version available on CRAN. Older versions can be found here.

Installation

retrosheet can be installed from CRAN, or development versions installed from Github.

# Install from CRAN
install.packages("retrosheet")

# Install development version from Github
# install.packages("devtools")
devtools::install_github("colindouglas/retrosheet")

Usage

  • getRetrosheet() - This workhorse function returns the full seasonal data associated with the user-entered arguments
    • Use the cache argument to save a local cache and avoid stressing retrosheet.org
    • Use get_retrosheet() as a drop-in replacement to return tibbles instead of matrices
  • getPartialGamelog() - An alternative to returning the full gamelog files. This function allows the user to choose the columns and date. Column names are made available by the global object gamelogFields

Also included are convenience functions

  • getFileNames() - for obtaining a list of all zip files currently available for use by this package
  • getTeamIDs() - for providing the team ID value to be used in the team argument of getRetrosheet()
  • getParkIDs() - for ballpark ID and name information.
Metadata

Version

1.1.6

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows