R/utilities.R

Defines functions convert_df2sf has_sf

has_sf <- function() {
  requireNamespace("sf", quietly = TRUE)
}

convert_df2sf <- function(obj, crs = 4326) {
  if (has_sf() && length(obj)) {
    obj <- sf::st_as_sf(obj, wkt = "wkt", crs = 4326)
  }

  obj
}

Try the icesVMS package in your browser

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

icesVMS documentation built on March 31, 2023, 5:49 p.m.