R/make180.R

Defines functions make180

Documented in make180

#' Convert Longitudes to (-180,180)
#' @keywords internal
#' \code{make180} is an internal function that converts a vector of longitudes
#' from (0,360) to (-180,180)
#'
#' @param lon A vector of longitudes
#' @return A vector of longitudes all mapped to (-180,180)
#'



make180 <- function(lon) {

    ind <- which(lon > 180)
    lon[ind] <- lon[ind] - 360
   return(lon)
}

Try the xtractomatic package in your browser

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

xtractomatic documentation built on May 2, 2019, 8:54 a.m.