#' Convert Longitudes into -180 to 180
#'
#' Takes in a set of longitude coordinate values, checks if they sit in the range [-180, 180] or [0, 360]. If the latter is true, then the coordinate values are coverted into the former.
#' @param lon_coords
longitude_checker <- function(lon_coords){
maxi <- max(lon_coords)
mini <- min(lon_coords)
if (maxi>180){
print('Converting Coordinate Values.')
coords <- lon_coords - 180
} else {
print('No Conversion Required.')
coords <- lon_coords
}
return(coords)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.