1. Installation
The TOC R package can be installed from CRAN, the official R packages repository, or from this GitHub repository.
The official release of the TOC R package can be found on CRAN. To install from CRAN enter the following command line in R (on Windows OS, run R as Administrator):
install.packages("TOC")
To install the development version of the TOC R package from this account on GitHub, first install the devtools R package using the following command:
install.packages("devtools")
Then install the TOC package from Github using the devtools package:
devtools::install_github("amsantac/TOC")
2. Construction of the TOC curve
Once installed from CRAN or GitHub, the TOC package can be loaded. The package includes sample data to run the examples:
library(TOC)
index <- raster(system.file("external/Prob_Map2.rst", package="TOC"))
boolean <- raster(system.file("external/Change_Map2b.rst", package="TOC"))
mask <- raster(system.file("external/MASK4.rst", package="TOC"))
The TOC and ROC curves can be generated and plotted using the following instructions:
tocd <- TOC(index, boolean, mask, nthres=100, progress=TRUE)
tocd
plot(tocd)
rocd <- ROC(index, boolean, mask, nthres=100, progress=TRUE)
rocd
plot(rocd)
For help on the functions implemented in the TOC package see the reference manual or run the following command lines in R:
?'TOC-package'
?TOC
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.