clean_japan: Clean Japanese Leaders Downloaded from Baseball-Reference

Description Usage Arguments Value Examples

View source: R/clean-japan.R

Description

Takes the Japanese data scraped from Baseball-Reference using scrape_bref and cleans it so that it can be combined with the data downloaded from PIA. Only used to process data for the apps.

Usage

1
clean_japan(dat, j_ids, type = c("bat", "pit"))

Arguments

dat

data.frame. Data scraped from Baseball-Reference

j_ids

data.frame of japanese ids for players who have played in both Japan and America. The j_ids are custom, used only in this app

type

character. Whether these are batting or pitching data. Defaults to batting

Value

tbl_df of japanese statistics that have been cleaned.

Examples

1
2
3
4
5
6
curr_wd <- getwd()
setwd("N:/Apps/simScoresApp/data")
dat <- read.csv("0-downloads/bat_japan.csv", header = T, stringsAsFactors = F)
jids <- read.csv("manual-info/japan_ids.csv", header = T, stringsAsFactors = F)
y <- clean_japan(dat, jids, "bat")
setwd(curr_wd)

guytuori/simScores documentation built on May 17, 2019, 9:29 a.m.