R/utils.R

Defines functions .is.spatial .create_unique_colname

.create_unique_colname <- function(
  id = "id", # candidate name
  nm # vector containing the existing names
  ){
  new_id <- id
  k <- 0
  while(new_id %in% nm) {
    new_id <- paste(id, k, sep = "")
    k <- k + 1
  }
  id
}

.is.spatial <- function(x) {
  if (inherits(x, "Spatial") | inherits(x, "Raster"))
    res <- TRUE
  else
    res <- FALSE

  res
}

Try the clhs package in your browser

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

clhs documentation built on Oct. 14, 2021, 9:06 a.m.