# mapdiff: Compute the difference between two maps In ndvits: NDVI Time series extraction and analysis

### Description

Compute the difference between two maps.
If the map of the standard deviation is given, the difference is divided by the standard deviation.

### Usage

 1 mapdiff(mapin, mapref, mapsd = FALSE, outfile = FALSE) 

### Arguments

 mapin raster map mapref raster map 2 (the reference) mapsd raster map conaining the standard deviation values. If mapsd=FALSE, the standard deviation is not taken into account while computing the difference. By default, mapsd = FALSE. outfile file where the difference map is saved. If outfile=FALSE, the map is not saved but only returned. By default, outfile = FALSE.

### Details

If mapsd is defined :

diff = \frac{mapin - mapref}{mapsd}

else :

diff = mapin - mapref

### Value

Returns the difference map

### Author(s)

Romain Frelat and Bruno Gerard

### Examples

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ndvidirectory=paste(system.file("extdata/VITO_Mzimba", package="ndvits"), "/", sep="") region="Mzimba" filein=timetoMap(ndvidirectory,region, 2004,1,1) filein2=timetoMap(ndvidirectory,region, 2005,1,1) #load the maps map04=readpartGDAL(filein) map05=readpartGDAL(filein2) #computing the difference of the 2 maps diff=mapdiff(map04, map05) #plot the difference map : savemap(diff) 

ndvits documentation built on May 21, 2017, 12:33 a.m.

Search within the ndvits package
Search all R packages, documentation and source code