Learn R Programming

ENiRG (version 1.0.1)

stdz.maps: Standardization of raster maps

Description

This function standardizes according to the mean of the values contained in a raster map, previously imported into GRASS.

Usage

stdz.maps(map.names, output.names = NULL)

Arguments

map.names
character string. Name of a raster maps to be standardized.
output.names
character string. Output name of the standardized raster map.

Value

This function returns a new raster map resulted from the normalization. When no output names are provided, obtained maps will be the same as the input, but adding a prefix "std_"

Details

When working with multiple rasters, it is often necessary to measures them at the same numerical scale. The standardization allows to easier find maximum likelihood estimates and thus compare one raster to the others. It is important to retrieve the mean and standard deviation for each raster individually and then normalize all the different raster maps. This function calculates univariate statistics (minimum and maximum cell values, range, arithmetic mean, population variance, standard deviation, and coefficient of variation) from the non-null cells of a raster map.

Normalized raster map is then calculated following this normalized equation:

$Z_{(i,j)} = \frac{x_{(i,j)} - \bar{X}}{\sigma _{X}}$

, where $Z_{(i,j)}$ is the normalized value in a particular cell of cartesian coordinates (i,j) in the resolution of the map, $x_{(i,j)}$ is the current value for that cell, $\bar{X}$ is the mean of the map and $\sigma _{X}$ is the standard deviation of the map.

See Also

import.egvs, enirg, initGRASS

Examples

Run this code
## Not run: 
# # starting GRASS session
# # initGRASS("/usr/bin/grass-7.0.0", home=tempdir())
# # initGRASS("C:/GRASS", home=tempdir())
# 
# ## Path to the file to be imported
# file1 <- paste(system.file(package = "ENiRG"), "/ext/tann.asc", sep="")
# 
# import.egvs(file1, "tann")
# 
# stdz.maps("tann","std_tann")
# 
# ## End(Not run)

Run the code above in your browser using DataLab