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.
Package details |
|
---|---|
Maintainer | Colin Steffe <colin.steffe@unil.ch> |
License | MIT + file LICENSE |
Version | 0.1.0 |
URL | https://https://github.com/ptds2021/pkghm4g6 |
Package repository | View on GitHub |
Installation |
Install the latest version of this package by entering the following in R:
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.