Learn R Programming

TOC (version 0.0-6)

scaling: scale the output TOC values and change units

Description

scale the 'Hits' and 'Hits+FalseAlarms' values in the TOC output table, as well as the prevalence and population, using a scaling factor. Labels for the modified units in the TOC object are changed to newUnits

Usage

# S4 method for Toc
scaling(x, scalingFactor, newUnits)

Value

an object of class TOC

Arguments

x

an object of class Toc

scalingFactor

numeric value to scale 'Hits' and 'Hits+FalseAlarms' values in the TOC output table, as well as the prevalence and population

newUnits

charater string for the new data units in the TOC object

See Also

TOC, ROC

Examples

Run this code
index <- rast(system.file("external/Prob_Map2.rst", package = "TOC"))
boolean <- rast(system.file("external/Change_Map2b.rst", package = "TOC"))
mask <- rast(system.file("external/MASK4.rst", package = "TOC"))
tocd <- TOC(index, boolean, mask, nthres = 100)
plot(tocd)

## scale units from square m to square km
tocd_sqkm <- scaling(tocd, scalingFactor = 1000000, newUnits = "square km")
plot(tocd_sqkm) 

Run the code above in your browser using DataLab