R/deg2rad.R

#' Convert degrees to radians
#' 
#' @export deg2rad
#' 
#' @param deg vector of degrees to be converted to radians
#' 
#' @examples
#' data(vdendool)
#' 
#' ## latitude in degrees
#' degrees <- coordinates(vdendool)[, 2]
#' head(degrees)
#' 
#' ## latitude in radians
#' radians <- deg2rad(coordinates(vdendool)[, 2])
#' head(radians)
#' 
deg2rad <- function(deg) {
  
  radians <- deg * pi / 180
  return(radians)
  
}

Try the remote package in your browser

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

remote documentation built on May 1, 2019, 11:30 p.m.