spplotLog: Plot methods for spatial data with logarithmic scale

Description Usage Arguments Details Value Author(s) Examples

View source: R/spplotLog.R

Description

This function extends spplot; it enabels logarithmic scaling.

Usage

1
spplotLog(x, zcol, base, nTicks = 10, replace0 = FALSE, minNonzero = 0, ...)

Arguments

x

SpatialDataFrame-class object to be plotted

zcol

character; name(s) of attribute(s) to be plotted

base

integer; base for the logarithmic transformation, to be used in the ticks; if none is indicated it is selected automatically to fit the range of the data

nTicks

integer; number of ticks - approximate -

replace0

logical; if zeros are to be replaced by a value that can be displayed on logscale. The tick of the key at this value will show "0". If replace0 = FALSE 0 is plotted as missing value.

minNonzero

numeric >= 0; all values below minNonzero are replaced by 0. Can be used to avoid that very small values dominate the plot.

...

parameters to be forwarded to spplot for style, colour etc.

)

Details

The key refers to the original values although in the background log transformed data are used (except from SpatialPointsDataFrame where just the cuts are changed).

Value

A plot.

Author(s)

Kristina B. Helle, kristina.helle@uni-muenster.de

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(SPixelsDF)
data(SPointsDF)
# add arbitrary data to show the effect of different values (< 0, == 0, small, big)
SPixelsDF@data$a = c(-5, 0, 0.003, 10, 57, 320, 444, 1000, 10000)
# replace 0 and small values
spplotLog(SPixelsDF, replace0 = TRUE, minNonzero = 0.05)
# choose base an number of ticks manually; forward parameters to spplot
spplotLog(SPixelsDF, base = 5, nTicks = 20,
          col.regions = heat.colors,
          sp.layout = list("sp.points", SPointsDF[1,]))

KristinaHelle/sensors4plumes documentation built on May 7, 2019, 12:31 p.m.