/EBSpatCGAL

EBSpat CGAL version

Primary LanguageC++

EBSpatCGAL

Development tools around nearest-neigbours type Gibbs point processes based on CGAL.

Requirement

EBSpatCGAL is an adaptation of EBSpat (no more developped) using CGAL.

For MacOSX user: install brew and then

brew install cgal

For Windows user: see install steps described in the last section.

Install

Since this package is in development, it is not yet on CRAN but thanks to devtools R package (to install first if necessary), you can install it in a R session:

remotes::install_github("rcqls/EBSpatCGAL")

examples

require(EBSpatCGAL)
del2 <- Delaunay()
insert(del2,x=runif(n<-100),y=runif(n))
plot(del2)
area(del2)		#or volume(del2)
area(del2,3) 	#area of the third point
require(EBSpatCGAL)
del3 <- Delaunay(3)
insert(del3,x=runif(n<-100),y=runif(n),z=runif(n))
plot(del3)
volume(del3)
volume(del3,3) #area of the third point

Windows install

  1. Install Msys2 32bits system is preferred since it is compatible with 64bits system.

  2. Then install gcc for MinGW64 and cgal after opening the Mingw32 console (not the msys2 one):

pacman -S mingw-w64-i686-gcc make mingw-w64-i686-cgal

Also, add the following code in your .bash_profile

if [[ $MSYSTEM =~ ^MINGW ]]; then
  export PATH=/mingw32/bin:$PATH
fi
  1. You also need to recompile Rcpp from source, install devtools and then install EBSpat after opening R (added to PATH) in the console:
#  add INSTALL_opts="--no-multiarch" as argument of install.packages if it makes sense
install.packages("Rcpp",type="source")
install.packages(‘devtools’)
# add args="--no-multiarch" as argument of install_github if it makes sense
devtools::install_github('rcqls/EBSpatCGAL’)
  1. If you want to use the package inside the Rgui.exe or Rstudio, add C:\msys2\mingw32\bin in the Windows PATH (where C:\msys2 is supposed here to be where Msys2 is installed).