knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

nemo

nemo finds the largest empty circle in the plane whose interior does not overlap with any given obstacles. nemo includes ony two functions :

Installation

You can install the development version from GitHub with:

``` {r eval=F}

install {remotes} if not already

if (!requireNamespace("remotes")) { install.packages("remotes") }

install nemo for github

remotes::install_github("mtmx/nemo")

## Example

A basic example to find the largest empty circle inside a set of points and its center aka the point nemo :

```r
library(nemo)
data(points)
hull_pts <-
nemo_hull(points = points %>% st_transform(2154),
            concavity =2,
            length_threshold = 10)

nemo_pts <-
nemo_circle(points = points %>% st_transform(2154),
            hull = hull_pts %>% st_buffer(dist=500),
            strict_inclusion = T,
            nmax_circles = 1)

# mapping output
library(ggplot2)

ggplot() +
  geom_sf(data = hull_pts %>% st_buffer(dist=500)  , size = 0.2) +
  geom_sf(data = nemo_pts ,
          size = 1,
          fill=NA,
          color = "red") +
  geom_sf(data = nemo_pts %>% st_centroid() ,
             size = 1,
             col = "red") +
  geom_sf(data=points %>% st_transform(2154))


mtmx/nemo documentation built on Nov. 4, 2019, 8:31 p.m.