Skip to content

Instantly share code, notes, and snippets.

@juanitobanca
Created March 9, 2017 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juanitobanca/6720ce116cdfe6d0a55df476e76cd371 to your computer and use it in GitHub Desktop.
Save juanitobanca/6720ce116cdfe6d0a55df476e76cd371 to your computer and use it in GitHub Desktop.
f_names <- function( p_pk_factors )
{
p_file <- fread( input = "./parks.csv"
, header = T
, sep = ','
, na.strings = ''
, stringsAsFactors = F
, colClasses = c( 'character' # BALL_PARK_ID
, 'character' # BALL_PARK_NAME
, rep( x = 'NULL', 7 ) # 9
)
, col.names = c( 'PARK_ID', 'PARK_NAME' )
)
inner_join( x = p_file
, y = p_pk_factors
, by = c("PARK_ID")
) %>%
select( YEAR, PARK_ID, PARK_NAME, TEAM_ID, YEARS, H_RS, H_RA, H_G, A_RS, A_RA, A_G, PK_FACTOR )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment