This server is intended for use for Academic Classwork related Git repositories only. Projects/repositories will generally be removed after 6 months following close of the semester. Inactive repositories from previous semester are now being archived when no activity for 365 days. They are renamed and marked as 'archived'. After 90 days in that state they will be removed from the system completely.

Commit da51e709 authored by Nathaniel Skelton's avatar Nathaniel Skelton

Fixed build/execution issue regarding method location

parent 14e13d2c
library(dplyr)
library(purrr)
source("../src/utils.R")
# import all data
mlb_train <- read.csv(
......@@ -34,20 +35,6 @@ basic_mlr <- function() {
}
# basic_mlr()
# Convert wind to a fraction of 1 (on the batter's nose) # based on cosine of
# the angle off the batter.
wind_dir_to_batter_azimuth <- function(wind_dir_words) {
ifelse(wind_dir_words == "L To R", 0,
ifelse(wind_dir_words == "R To L", 0,
ifelse(wind_dir_words == "In From RF", .525,
ifelse(wind_dir_words == "In From CF", 1,
ifelse(wind_dir_words == "In From LF", .525,
ifelse(wind_dir_words == "Out To LF", -.525,
ifelse(wind_dir_words == "Out To CF", 1,
ifelse(wind_dir_words == "Out To RF", -.525,
0))))))))
}
groupby_wind_dir <- function() {
# print(unique(mlb_train$wind_direction))
# Convert wind dir in words to relative strength (pro batter).
......
......@@ -13,3 +13,17 @@ add_high_error_rate_col <- function(dfrm) {
dfrm$high_error_rate <- ifelse(dfrm$total_e_per_9 > .59, T, F)
dfrm
}
# Convert wind to a fraction of 1 (on the batter's nose) # based on cosine of
# the angle off the batter.
wind_dir_to_batter_azimuth <- function(wind_dir_words) {
ifelse(wind_dir_words == "L To R", 0,
ifelse(wind_dir_words == "R To L", 0,
ifelse(wind_dir_words == "In From RF", .525,
ifelse(wind_dir_words == "In From CF", 1,
ifelse(wind_dir_words == "In From LF", .525,
ifelse(wind_dir_words == "Out To LF", -.525,
ifelse(wind_dir_words == "Out To CF", 1,
ifelse(wind_dir_words == "Out To RF", -.525,
0))))))))
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment