savemap: Save a map.

Description Usage Arguments Author(s) See Also Examples

Description

Save a given map in the desire format.

Usage

1
2
3
savemap(map, outname = "map", outext = "show", title = "",
    shapefile = NULL, shapedir = NULL, shapeext = "shp", 
    label = FALSE, pal = "Spectral", ...)

Arguments

map

raster to be saved or displayed

outname

name of the file where the map is saved (without extension).

outext

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

title

title of the map.
By default, title="".

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".
If shapedir=NULL, no object will be added to the map. By default, shapedir=NULL.
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".

label

name of the label of the points to be displayed on the map.
For a shapefile, please indicates the name of the category you want to see. For a kml file, label="Name". If label=FALSE, no label will be plotted. By default, label=FALSE.

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".

...

further arguments sent to spplot.

Author(s)

Romain Frelat and Bruno Gerard

See Also

multimap

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#local variables
ndvidirectory=paste(system.file("extdata/VITO_Mzimba",
    package="ndvits"), "/", sep="")
region="Mzimba"
#finding the path to the map of the 1st of January 2004
filein=timetoMap(ndvidirectory,region, 2004,1,1)
#loading the raster
map=readpartGDAL(filein)

#executing savemap
savemap(map, outname="Mzimba01012004", title = "NDVI values 1st
    of January 2004 in Mzimba")

#adding points to the map
shape="SLP_Mzimba"
shapedir=paste(system.file("extdata/shape", package="ndvits"),
    "/", sep="")
savemap(map, outname="Mzimba01012004", title = "NDVI values 1st
    of January 2004 in Mzimba", shapefile=shape,
    shapedir=shapedir, label="Village")

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

Related to savemap in ndvits...