Nothing
.onLoad <- function(libname, pkgname) {
ep_model <- load_ep_model()
fg_model <- load_fg_model()
wp_model <- load_wp_model()
assign("ep_model", ep_model, envir = parent.env(environment()))
assign("fg_model", fg_model, envir = parent.env(environment()))
assign("wp_model", wp_model, envir = parent.env(environment()))
}
load_ep_model <- function(){
ep_model <- NULL
# load the model from GitHub because it is too large for the package
.url = url("https://raw.githubusercontent.com/sportsdataverse/cfbfastR-data/main/models/ep_model.Rdata")
on.exit(close(.url))
try(
load(.url),
silent = TRUE
)
return (ep_model)
}
load_fg_model <- function(){
fg_model <- NULL
.url = url("https://raw.githubusercontent.com/sportsdataverse/cfbfastR-data/main/models/fg_model.Rdata")
on.exit(close(.url))
try(
load(.url),
silent = TRUE
)
return (fg_model)
}
load_wp_model <- function(){
wp_model <- NULL
.url = url("https://raw.githubusercontent.com/sportsdataverse/cfbfastR-data/main/models/wp_model.Rdata")
on.exit(close(.url))
try(
load(.url),
silent = TRUE
)
return (wp_model)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.