convexHull: Plots the convexhull polygon from the data (latitude,...

Description Usage Arguments Details Value Examples

View source: R/rectifiedI.R

Description

convexHull Computes the area and centroid of the convex hull from the (latitute, longitude) vector. It provides a plot of how the points are dispersed in the field of interest.

Usage

1
convexHull(X, varOfInterest)

Arguments

X

dataframe with two colums, latitute and longitude respectively.

varOfInterest

variable of interest to plot. This variable is needed to color the points on the convexhull.

Details

Consideration for this function:

Value

A vector with two elements, the first element is the area and the second one is the centroid. The centroid is a list of two elements, latitude and longitude that represents the centroid. To have a visual idea of the returned object, it has the following shape [area,[latitude,longitude], plotObject].

Examples

1
2
3
fileInput <- system.file("testdata", "chen.csv", package="Irescale")
data<-loadFile(fileInput)
area_centroid<-convexHull(data$data,data$varOfInterest)

Example output

Warning messages:
1: Use of `X[[1]]` is discouraged. Use `.data[[1]]` instead. 
2: Use of `X[[2]]` is discouraged. Use `.data[[2]]` instead. 
3: Use of `pol[[1]]` is discouraged. Use `.data[[1]]` instead. 
4: Use of `pol[[2]]` is discouraged. Use `.data[[2]]` instead. 

Irescale documentation built on Nov. 22, 2019, 1:07 a.m.