R/matrix-main.R

Defines functions matrix_url matrix_path

matrix_path <- function(endpoint) {
    matpath <- mz_get_host("matrix")$path
    if (is.null(matpath)) {
        res <- endpoint
    } else {
        res <- paste(matpath, endpoint, sep = "/")
    }
    res
}
matrix_url <- function(endpoint, ..., api_key) {
    if (is.null(api_key)) api_key <- mz_key(which = "matrix")
    query <- list(...)
    query <- c(api_key = api_key, query)
    structure(
        list(
            scheme = mz_get_host("matrix")$scheme,
            hostname = mz_get_host("matrix")$hostname,
            path = matrix_path(endpoint),
            query = query),
        class = "url"
    )
}

matrix_GET <- httr::GET

Try the rmapzen package in your browser

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

rmapzen documentation built on Oct. 17, 2023, 5:06 p.m.