R/make180.R

Defines functions make180

# Convert Longitudes to (-180,180)
# 'make180()' is an internal function that converts a vector of longitudes
# from (0,360) to (-180,180)
#
# 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 rerddapXtracto package in your browser

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

rerddapXtracto documentation built on Oct. 19, 2023, 1:06 a.m.