pfSimpleGrid(TR, tarAge, hw, binhw = 0.5 * mean(diff(tarAge)), fun = mean, n.boot = 0, prob.CI = c(0.025, 0.975), test.val = 0, proj4 = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs", res = 5, ext = c(-180, 180, -90, 90), fig.file.name = NULL, show.plots = TRUE, title.text = "", cols = NULL, cuts = NULL, zlim = NULL, base.map = "coasts", base.map.col = grey(0.7), base.map.lwd = 0.5)pfTransformgrd.res is a single number, the grid will be defined with equal
x/y resolution; a two-element vector (x,y) can also be supplied for
unequal resolution. grd.ext is specified as a vector, matrix, or Extent
object, as for the function raster::extent.cuts and assigned the colors in
cols. If either are NULL, the function tries to guess at a good scheme.
cuts may also be a single value specifying the number of bins.cuts is fully specified, but otherwise used in defining the color bins.'coasts' or 'countries' to
choose which base map (from required library 'rworldmap') to be
plotted as the base map for all plots. Could easily be modified to accept
any SpatialPolygons object.Raster-class object containing the gridded
output data update.trellis function, and plotted or used in layouts as
any other trellis graphics can. Records are first composited, and then aggregated with other sites falling in the same grid cell according to the specified function 'fun' (defauts to mean). This is a considerably simpler approach than the distance-based spatial binning used by pfDotMap, although it has its own tradeoffs (e.g. grid cells are unlikely to represent equal area).
A flexible bootstrapped significance test is implemented. Within each time bin X grid cell combination, composite z-score values are randomly sampled (with replacement) from sites within the grid cell. The function is applied to the sampled values. Quantiles of all bootstrap function evaluations are computed, and significance is reported if a user-specified test value is outside of these bootstrap CI. Note that bootstrap CI calculated here reflect only spatial variability, as no temporal resampling is performed.
pfGridding
## Not run:
# ID=pfSiteSel(id_region==c("WNA0"), l12==1 & long<(-130))
# plot(ID)
#
# ## Transform data
# res3=pfTransform(ID,method=c("MinMax","Box-Cox","Z-Score"),BasePeriod=c(200,4000))
#
# ## Plot maps for 1000-yr bins spanning 3-0 kBP
# # dev.new(width=10,height=10) # A big plot area helps.
# gridmap = pfSimpleGrid( TR=res3, tarAge=seq(0,2000,1000), hw=500, ext=c(-170,-80,40,80))
# summary(gridmap)
#
# # Plot the mean map from the first time bin
# newmap = update(gridmap$sg.plots[[1]], main="A relabeled map")
# newmap
# ## End(Not run)
Run the code above in your browser using DataLab