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

shapegrid

Creates a grid of points enclosed within a shape. Code taken from https://people.sc.fsu.edu/~jburkardt/cpp_src/. Install package dependencies:

pkgs = c("Rcpp", "remotes" )
install.packages(pkgs)

Then install shapegrid package from github:

remotes::install_github("daffp/shapegrid")

Run some examples to see that it is working.

An ellipse

library(shapegrid)
par(pty="s")
p = ellipse_grid(10, c(3,5), c(0,0))
plot(p, pch=16, cex=0.5, ylim=c(-5, 5), xlim=c(-5, 5))

A triangle

par(pty="s")
p = triangle_grid(10, c(0,0, 5,0, 2.5,5))
plot(p, pch=16, cex=0.5)


daffp/shapegrid documentation built on Aug. 2, 2020, 12:49 a.m.