R/modelarchive.R

Defines functions modelarchive_data modelarchive_model

# unexported functions for use in tests

modelarchive_model <- function(name) {
    tmp <- tempfile()
    url <- paste0("https://raw.github.com/vincentarelbundock/modelarchive/main/data/", name, ".rds")
    try(utils::download.file(url, tmp, quiet = TRUE), silent = TRUE)
    out <- try(readRDS(tmp), silent = TRUE)
    return(out)
}

modelarchive_data <- function(name) {
    dat <- sprintf(
        "https://raw.githubusercontent.com/vincentarelbundock/modelarchive/main/data-raw/%s.csv",
        name)
    out <- utils::read.csv(dat)
    return(out)
}

Try the marginaleffects package in your browser

Any scripts or data that you put into this service are public.

marginaleffects documentation built on Oct. 20, 2023, 1:07 a.m.