R/pcorr.R

Defines functions pcorr

Documented in pcorr

#' Polygonal symbolic correlation
#'
#' Compute the symbolic polygonal empirical correlation.
#' 
#' @param polygons A list of matrices of dimension l x 2, where l represent number of sides polygon.
#' @return The method returns a integer.
#' @examples 
#' x <- psim(10, 10) #simulate 10 polygons of 10 sides
#' pcorr(x)
#' @export
pcorr <- function(polygons){
  if(length(polygons) < 1){
    stop("Insert a valid number of polygons!")
  }
  covariance <- pcov(polygons)
  variance <- pvar(polygons)
  correlation <- covariance/(sqrt(variance[1])*sqrt(variance[2]))
  correlation
}

Try the psda package in your browser

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

psda documentation built on July 1, 2020, 6:10 p.m.