Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

xyplot-methods

xyplot for Raster objects


Description

Scatter plots of space-time Raster objects for directions defined by xyLayer

Usage

## S4 method for signature 'RasterStackBrick,missing'
xyplot(x, data=NULL, dirXY=y,
       stat='mean', xlab='Time', ylab='',
       digits=0, par.settings=rasterTheme(),
       auto.key = FALSE, ...)
## S4 method for signature 'SpatRaster,missing'
xyplot(x, data=NULL, dirXY=y,
       stat='mean', xlab='Time', ylab='',
       digits=0, par.settings=rasterTheme(),
       auto.key = FALSE, ...)

Arguments

x

A RasterStackBrick object or a SpatRaster object whose z slot or time index are not NULL.

data

Not used.

dirXY

A direction as a function of the coordinates (see xyLayer).

stat

a function to be applied to summarize the values by zone. See zonal for details.

xlab, ylab

Labels of the axis.

par.settings

Customization of lattice. See xyplot for details.

digits

An integer, number of digits for zonal.

auto.key

A logical or a list. If it is FALSE (default) a label with the value of the direction (as defined by dirXY)will be printed next to each line. You should read the help page of xyplot for details about the usage of auto.key as a list.

...

Additional arguments for the xyplot function.

Author(s)

Oscar Perpiñán Lamigueiro

See Also

zonal

Examples

## Not run: 
dataURL <- "https://raw.github.com/oscarperpinan/bookvis/master/data/"

##Solar irradiation data from CMSAF http://dx.doi.org/10.5676/EUM_SAF_CM/RAD_MVIRI/V001
old <- setwd(tempdir())
download.file(paste0(dataURL, "SISmm2008_CMSAF.zip"),
   "SISmm2008_CMSAF.zip", method='wget')
unzip("SISmm2008_CMSAF.zip")

listFich <- dir(pattern='\\.nc')
stackSIS <- stack(listFich)
stackSIS <- stackSIS*24 ##from irradiance (W/m2) to irradiation Wh/m2

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

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

xyplot(SISmm)

## End(Not run)

## Not run: 
library(zoo)

url <- "ftp://ftp.wiley.com/public/sci_tech_med/spatio_temporal_data/"
sst.dat = read.table(paste(url, "SST011970_032003.dat", sep=''), header = FALSE) 
sst.ll = read.table(paste(url, "SSTlonlat.dat", sep=''), header = FALSE)

spSST <- SpatialPointsDataFrame(sst.ll, sst.dat)
gridded(spSST) <- TRUE
proj4string(spSST) = "+proj=longlat +datum=WGS84"
SST <- brick(spSST)

idx <- seq(as.Date('1970-01-01'), as.Date('2003-03-01'), by='month')
idx <- as.yearmon(idx)
SST <- setZ(SST, idx)
names(SST) <- as.character(idx)

xyplot(SST)

## End(Not run)

rasterVis

Visualization Methods for Raster Data

v0.50.2
GPL-3
Authors
Oscar Perpinan Lamigueiro [cre, aut] (<https://orcid.org/0000-0002-4134-7196>), Robert Hijmans [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.