Learn R Programming

rasterVis (version 0.10-2)

levelplot-methods: Level plots of Raster objects.

Description

Level plots of Raster objects with lattice methods and marginal plots with grid objects.

Usage

## S3 method for class 'Raster,missing':
levelplot(x, data=NULL, layers,
            margin=TRUE, FUN.margin=mean,
            maxpixels=1e5,
            par.settings=rasterTheme,
            between=list(x=0.5, y=0.2),
            as.table=TRUE,
            xlab='', ylab='', main='',
            scales=list(draw=TRUE),
            xscale.components=xscale.raster,
            yscale.components=yscale.raster,
            colorkey=list(space='right'),
            ...)

Arguments

docType

methods

Details

The result of this method is similar to the spplot method for Raster objects defined in the raster package. However, this method does not use the spplot of the sp package and, therefore, no conversion between classes is needed.

See Also

spplot, levelplot

Examples

Run this code
f <- system.file("external/test.grd", package="raster")
r <- raster(f)
levelplot(r)

##Solar irradiation data from CMSAF
##Data available from http://www.box.net/shared/rl51y1t9sldxk54ogd44

old <- getwd()
##change to your folder...
setwd('CMSAF')
listFich <- dir(pattern='2008')
listNC <- lapply(listFich, raster)
stackSIS <- do.call(stack, listNC)
stackSIS <- stackSIS*24 ##from irradiance (W/m2) to irradiation Wh/m2
setwd(old)

idx <- seq(as.Date('2008-01-15'), as.Date('2008-12-15'), 'month')

SISmm <- setZ(stackSIS, idx)
layerNames(SISmm) <- month.abb

levelplot(SISmm)

levelplot(SISmm, layers=1, FUN.margin=median, contour=TRUE)

Run the code above in your browser using DataLab