Learn R Programming

rasterVis (version 0.10-2)

histogram-methods: Histogram of Raster objects.

Description

Draw histograms (with lattice) of Raster objects.

Usage

## S3 method for class 'RasterLayer,missing':
histogram(x, data=NULL, maxpixels = 1e+05, breaks=100, 
            xlab='', ylab='', main='', col='gray', ...)

## S3 method for class 'RasterStackBrick,missing': histogram(x, data=NULL, layer, FUN, maxpixels = 1e+05, breaks=100, xlab='', ylab='', main='', col='gray', between=list(x=0.5, y=0.2), as.table=TRUE, xscale.components=xscale.raster, yscale.components=yscale.raster, par.settings=rasterTheme, ...)

Arguments

docType

methods

See Also

histogram,xscale.raster, yscale.raster, rasterTheme

Examples

Run this code
##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

histogram(SISmm)
histogram(SISmm, FUN=as.yearqtr)

Run the code above in your browser using DataLab