Summary

In this document, we show how to install ntbox on different platforms (Windows, Mac OS, and Linux). As some functions of the package use compiled code, the user should have developer tools installed on the computer; once installed it is stright foward to install the package.

note:ntbox works on R version >= 3.6. We recommend version 4.0

Windows

Install RTools(https://cran.r-project.org/bin/windows/Rtools/).

RTools has a collection of resources for building packages for R under Microsoft Windows, or for building R itself (version 1.9.0 or later). The original collection was put together by Prof. Brian Ripley and Duncan Murdoch; it is currently maintained by Jeroen Ooms.”

RTools web site

Rtool.exe

Ensuere to add RTools to systems path

Install pandoc from

https://github.com/jgm/pandoc/releases/tag/2.9.2

Linux

Install the R development package, usually called r-devel or r-base-dev.

Install the C/C++ libraries that let R work as Geographic Information System (GIS)-

  • gdal-devel GDAL - Geospatial Data Abstraction Library. “GDAL is a translator library for raster and vector geospatial data formats that is released under an X/MIT style Open Source license by the Open Source Geospatial Foundation. As a library, it presents a single raster abstract data model and single vector abstract data model to the calling application for all supported formats. It also comes with a variety of useful command line utilities for data translation and processing.”

  • geos-devel Geometry Engine - Open Source. “GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS). As such, it aims to contain the complete functionality of JTS in C++. This includes all the OpenGIS Simple Features for SQL spatial predicate functions and spatial operators, as well as specific JTS enhanced topology functions.”

  • Proj4. “PROJ is a generic coordinate transformation software, that transforms geospatial coordinates from one coordinate reference system (CRS) to another. This includes cartographic projections as well as geodetic transformations”.

Install and configure java openjdk

If you are using a fedora distribution you can

sudo yum install java-1.8.0-openjdk-devel
sudo yum install java-1.8.0-openjdk-headless
sudo /usr/bin/R CMD javareconf

This code installs the SIG libraries

sudo yum install gdal-devel proj-devel proj-epsg proj-nad geos-devel

Some other C/C++ and javascript libraries

sudo yum install ncftp libxml2-devel libxslt v8-devel
sudo yum install mesa-libGL-devel mesa-libGLU-devel
sudo yum install libpng-devel libssl-devel
sudo yum install openssl-devel
sudo yum install libcurl-devel

Install pandoc from

https://github.com/jgm/pandoc/releases/tag/2.9.2

Mac OS

On Mac, install the Xcode command line tools. Open terminal and type:

xcode-select --install

We highly recommend to have installed Homebrew; Homebrew gives the user an easy way to install development libraries …

Homebrew installs the stuff you need that Apple (or your Linux system) didn’t.”

To install C/C++ Geographic Information System libraries via homebrew you just need to go to the terminal and type:

brew install geos gdal proj netcdf

The other C/C++ and javascript libraries

brew install v8 libpng curl libxml2

Install pandoc

brew install pandoc 

Package installation

First install devtools

if (!require('devtools')) 
  install.packages('devtools')

Then load devtools and use the function devtools::install_github. ntbox is on continue development so the latest version of the package is on the author’s github repository (https://github.com/luismurao/ntbox)

library(devtools)
devtools::install_github("luismurao/ntbox")

Load the GUI of ntbox

Once ntbox is installed type the following commands on R:

library(ntbox)
ntbox::run_ntbox()

The above will launch the Graphical User Interface (GUI) of ntbox

Graphical User Interface of ntbox