Description Usage Arguments Value Examples
This removes extra columns that are no longer needed and sorts the data.
1 | final_clean(dat, type = c("bat", "pit"))
|
dat |
data.frame obtained from |
type |
character. Whether these are batting or pitching data. Defaults to batting |
tbl_df
of statistics, bio, position, and DL information that
are ready to be processed for the apps.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | curr_wd <- getwd()
setwd("N:/Apps/simScoresApp/data")
stats <- read.csv("4-mles/bat-mles.csv", header = T, stringsAsFactors = F) %>% tbl_df() %>% mutate(MLBID = as.character(MLBID))
bio <- read.csv("manual-info/bio_bat.csv", header = T, stringsAsFactors = F) %>% tbl_df() %>% mutate(MLBID = as.character(MLBID))
pos <- read.csv("manual-info/positions.csv", header = T, stringsAsFactors = F) %>% tbl_df() %>% mutate(MLBID = as.character(MLBID))
dl <- read.csv("manual-info/injuries.csv", header = T, stringsAsFactors = F) %>% tbl_df() %>% mutate(MLBID = as.character(MLBID))
x <- combine(stats, bio, pos, dl)
f <- final_clean(x, "bat")
# pitchers
pstats <- read.csv("4-mles/pit-mles.csv", header = T, stringsAsFactors = F) %>% tbl_df() %>% mutate(MLBID = as.character(MLBID))
pbio <- read.csv("manual-info/bio_pit.csv", header = T, stringsAsFactors = F) %>% tbl_df() %>% mutate(MLBID = as.character(MLBID))
px <- combine(pstats, pbio, pos, dl)
pf <- final_clean(px, "pit")
setwd(curr_wd)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.