maplocalstat: NDVI local statistics

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Compute basic statistics (min, max, mean and standard deviation) of NDVI maps between Ystart and Yend.

Usage

1
2
3
4
maplocalstat(ndvidirectory, region, Ystart, Yend, xlim = NULL,
    ylim = NULL, type="VITO_CLIP", outname=FALSE, outext="show",
    org=c(2,2), shapefile=NULL, shapedir=NULL, shapeext="shp",
    pal = "Spectral") 

Arguments

ndvidirectory

path to the ndvi images folder (GeoTIFF files).
Please note that paths to files in R can be specified with either "/" or "\\" in Windows OS and with "/" in UNIX OS.

region

name of the region, same as in the name of the ndvi images.
Please refer to details section for more information on the nomenclature.

Ystart

starting year of the analysis (in four-digit format).

Yend

ending year of the analysis (in four-digit format).

xlim

a two dimensions vector containing the longitude limits of the area of interest.
xlim=NULL indicates no longitude limits. By default, xlim=NULL.
Please note that xlim have to be in the same units and projection as the ndvi maps.

ylim

a two dimensions vector containing the latitude limits of the area of interest.
ylim=NULL indicates no longitude limits. By default, ylim=NULL.
Please note that ylim have to be in the same units and projection as the ndvi maps.

type

type of nomenclature followed by the NDVI images : "VITO_CLIP", "VITO_VGT" or "GIMMS" (see details section for more information).
By default, type = "VITO_CLIP".

outname

prefix of the name of the file where the maps containing the min, max, mean and sd are saved.
If outname=FALSE, the maps are not saved but only returned. By default, outname = FALSE.

outext

extension of the created maps.
If outext = "show", maps are displayed in the R graphics console.
Choose between "jpg", "png" or "pdf" to save the map in the corresponding format.
By default, outext = "show".

org

a two dimensions vector indicating the layout of the maps.
The first number is the number of rows, the second the number of columns.
Only 4 maps are displayed together, org=c(2,2) or org=c(1,4) or org=c(4,1).

shapefile

name of the shape/kml file with objects (points or polygons) to be displayed on the maps.
For a shapefile called ‘name.shp’ , shapefile="name".
For a kml file, write the name of the layer.
If shapefile=NULL, no object will be added to the map.
By default, shapefile=NULL.

shapedir

path to the shape/kml file.
For a shapefile, shapedir is the path to the folder containing the shapefile. For example if the directory of the shapefile is ‘C:/Dir/name.shp’, shapefile="C:/Dir/".
For a kml file, shapedir is the full directory of the kml file. For example shapefile="C:/Dir/name.kml".
Please note that paths to files in R can be specified with either "/" or "\\" in Windows OS and "/" in UNIX OS.

shapeext

extension of the shape/kml file : "shp" for a Esri shapefile or "kml" for a kml file from Google earth .
By default, shapeext = "shp".

pal

name of the palette of colors used to make the map from the package RColorBrewer.
To see the different palettes available for your map, please type display.brewer.all().
By default, pal="Spectral".

Details

maplocalstat load the maps between Ystart and Yend. Then it computes basics statistics (max, min, mean, sd) discarding NA values.

More about the variable type :
type = GIMMS : nomenclature from Global Land Cover Facility
[RE][YY][MMM][DDD].[SAT]-VIg.tif

type = VITO_VGT : FreeVGT VITO's nomenclature
NDV_[YYYYMMDD]_[REGION]_Extract.tif

type = VITO_CLIP : nomenclature after clipping the images in a particular region.
[REGION][YYYY]M[MM]P[D].tif

Value

The function returns 4 maps containing the basic statistics :

mean

The mean of the NDVI values between Ystart and Yend

max

The maximum of the NDVI values between Ystart and Yend

min

The minimum of the NDVI values between Ystart and Yend

sd

The standard deviation of the NDVI values between Ystart and Yend

Author(s)

Romain Frelat and Bruno Gerard

See Also

mapmaxyear,PeriodAnomaly,MaxAnomaly

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#local variables
ndvidirectory=paste(system.file("extdata/VITO_Mzimba",
    package="ndvits"), "/", sep="")
region="Mzimba"
Ystart=2004
Yend=2009

#executing maplocalstat

res=maplocalstat(ndvidirectory, region, Ystart, Yend,
    outname="Mzimba", outext="show")


#adding points to the map
shape="SLP_Mzimba"
shapedir=paste(system.file("extdata/shape", package="ndvits"),
    "/", sep="")

res=maplocalstat(ndvidirectory, region, Ystart, Yend,
    outname="Mzimba", outext="show", shapefile=shape,
    shapedir=shapedir)

ndvits documentation built on May 2, 2019, 4:47 p.m.

Related to maplocalstat in ndvits...