R/hRatio.R

Defines functions hRatio

Documented in hRatio

#' Calculate the height to width ratio of a spatial polygon
#'
#' @description Calculate the height to width ratio of a spatial polygon
#' 
#' @param SpatPolygon Spatial Polygons object
#'
#' @return numeric, ratio of diff
#'
#' @examples
#' require(ar.matrix)
#' hRatio(US.df)
#'
#' @export

hRatio <- function(SpatPolygon){
    dims <- unname(apply(SpatPolygon@bbox, 1, diff))
    dims[2]/dims[1]
}
nmmarquez/PointPolygon documentation built on Dec. 10, 2020, 1:15 a.m.