gmGeostats (version 0.10-6)

image_cokriged: Plot an image of gridded data

Description

Plot an image of one variable (possibly, one realisation) of output of cokriging or cosimulation functions.

Usage

image_cokriged(x, ...)

# S3 method for default image_cokriged( x, ivar = 3, breaks = quantile(as.data.frame(x)[, ivar], probs = c(0:10)/10, na.rm = TRUE), col = spectralcolors(length(breaks) - 1), legendPropSpace = 0.2, legendPos = "top", main = ifelse(is.character(ivar), ivar, colnames(x)[ivar]), ... )

# S3 method for spatialGridRmult image_cokriged( x, ivar = 1, isim = NULL, breaks = 10, mask = attr(x, "mask"), col = spectralcolors(length(breaks) - 1), legendPropSpace = 0.2, legendPos = "top", main = ifelse(is.character(ivar), ivar, dimnames(x)[[length(dimnames(x))]][ivar]), ... )

# S3 method for spatialGridAcomp image_cokriged( x, ivar = 1, isim = NULL, breaks = 10, mask = attr(x, "mask"), col = spectralcolors(length(breaks) - 1), legendPropSpace = 0.2, legendPos = "top", main = ifelse(is.character(ivar), ivar, dimnames(x)[[length(dimnames(x))]][ivar]), ... )

Arguments

x

object with the interpolated / simulated data; currently there are methods for "spatialGridAcomp" and "spatialGridRmult", but the default method is able to deal with "SpatialPointsDataFrame", "SpatialPixelsDataFrame" and "SpatialGridDataFrame" objects, and with the "data.frame" output of gstat::predict.gstat() and predict.gmSpatialModel()

...

generic functionality, currently ignored

ivar

which variable do you want to plot?

breaks

either the approximate number of breaks, or the vector of exact breaks to use for the plotting regions of the chosen variable

col

vector of colors to use for the image

legendPropSpace

which proportion of surface of the device should be used for the legend? trial and error might be necessary to adjust this to your needs

legendPos

where do you want your legend? one of c("top","left","right","bottom")

main

main title for the plot

isim

in case of simulated output, which simulation?

mask

optional mask object if x is of class "spatialGridAcomp" or "spatialGridRmult", and they have been masked (see setMask())

Value

Invisibly, a list with elements breaks and col containing the breaks and hexadecimal colors finally used for the z-values of the image. Particularly useful for plotting other plotting elements on the same color scale.

Methods (by class)

  • default: Plot an image of gridded data

  • spatialGridRmult: method for spatialGridRmult objects

  • spatialGridAcomp: method for spatialGridAcomp objects

Examples

Run this code
# NOT RUN {
getTellus(cleanup=TRUE, TI=TRUE)
load("Tellus_TI.RData")
head(Tellus_TI)
coords = as.matrix(Tellus_TI[,1:2])
compo = compositions::acomp(Tellus_TI[,3:7])
dt = spatialGridAcomp(coords=coords, compo=compo)
image_cokriged(dt, ivar="MgO") # equi-spaced
image_cokriged(dt, ivar="MgO", breaks = NULL) # equi-probable
# }

Run the code above in your browser using DataLab