Compute the difference between two maps.

If the map of the standard deviation is given, the difference is divided by the standard deviation.

1 |

`mapin` |
raster map |

`mapref` |
raster map 2 (the reference) |

`mapsd` |
raster map conaining the standard deviation values. |

`outfile` |
file where the difference map is saved.
If |

If mapsd is defined :

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

else :

*diff = mapin - mapref*

Returns the difference map

Romain Frelat and Bruno Gerard

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)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.