Previous: README
Next: 2. Scrape raw data
Since the contemporary form of ice hockey is in essence a Canadian sport, as a sign of appreciation I have written this project following conventions of Canadian programming. For example, instead of function is.numeric(), I’m using numeric.eh().
These function definitions are stored in file canadian.R, which is source()’d to other scripts used.
source("canadian.R")
# to keep the global environment clean, use a dedicated one for the functions.
# first check if it already exists
if (!exists(".canadian_programming")) {
# and if not, create it,
.canadian_programming <- new.env()
# add the needed functions
evalq({
infinite.eh <- function(...) { is.infinite(...) }
numeric.eh <- function(...) { is.numeric(...) }
na.eh <- function(...) { is.na(...) }
}, envir=.canadian_programming)
# and attach it to make the functions available
attach(.canadian_programming)
}
# EOF
Next: 2. Scrape raw data
Previous: README