ptds2021/pkghw4g6: Estimate and plot the area of a shape

The package estimates the area of a shape S and plots the shape. To estimate the area of the shape, the function estimate_area() simulates B random data points (or coordinates (x,y)) in a one by one square and assigns to each data point a value TRUE or FALSE whether it falls within the lines of the shape (i.e. within contraints) or not. Using the data points for which the assigned value is TRUE, we estimate the area of the shape by summing all TRUE values and divide them by the total number of data points (i.e. B parameter). Once the area is estimated and returned, the plot_area() function takes the value as only argument to plot the shape (using the constraints) and the data points. Data points which have a value TRUE (i.e lie within the shape) are in red and data points which have a value FALSE (i.e. lie outside the shape) are in blue.

Getting started

Package details

MaintainerColin Steffe <colin.steffe@unil.ch>
LicenseMIT + file LICENSE
Version0.1.0
URL https://https://github.com/ptds2021/pkghm4g6
Package repositoryView on GitHub
Installation Install the latest version of this package by entering the following in R:
install.packages("remotes")
remotes::install_github("ptds2021/pkghw4g6")
ptds2021/pkghw4g6 documentation built on Dec. 22, 2021, 9:58 a.m.