R/argo-url.R

Defines functions argo_url

Documented in argo_url

#' Construct Argo paths and URLs
#'
#' @inheritParams argo_path_info
#'
#' @return A full URL according to the current [argo_mirror()]
#'   and `path`.
#' @export
#'
#' @examples
#' argo_url("ar_index_global_prof.txt.gz")
#'
argo_url <- function(path) {
  path <- as_argo_path(path)

  if (length(path) == 0) {
    return(character(0))
  }

  path <- gsub("^/", "", path)
  paste0(argo_mirror(), "/", path)
}
paleolimbot/argodata documentation built on Dec. 13, 2021, 8:19 a.m.