ssExtra-package {ssExtra} | R Documentation |
This package provides some potentially useful helper functions for
working with objects created from the sampSurf package. It also
provides some S4 classes that extend the use of sampSurf to, e.g.,
double sampling. Currently, the main double sampling application is
the Monte Carlo addition to the generic monte
constructor for “Big BAF” sampling.
At this point the sampSurf package is quite large. Rather than continually adding to it until is capsizes under its own weight, perhaps the better option is to extend it with other smaller, more managable packages. This was done with the wavelet additions in the ssWavelets package, and thus is also used here. The routines in both ssWavelets and ssExtra are more specialized in general (though there are some interesting helper routines too) and thus placing them in other packages to be loaded only as needed seems to be a reasonable approach.
Package: | ssExtra |
Type: | Package |
Version: | 0.1-2 |
Date: | 12-May-2020 |
License: | GPL (>= 3) |
LazyLoad: | yes |
Please see the package vignette for some examples of how to use the routines in this package in conjunction with those in sampSurf.
The following S4 classes are defined within the ssExtra package to augment those in sampSurf with extended functionality. Objects of the non-virtual classes below can be created using constructor functions of the same name, see the Object Constructors section for details.
This is a simple class
made up of a related set of “sampSurf
”
objects.
ssDoubleSampling | Virtual base class for the following |
ssBigBAF | Class structure for “Big BAF” sampling |
This is a simple class with no subclasses.
ssCellStemList | Lists of Cells-in-Stems (inclusion zones) or Stems-in-Cells. |
Objects of this class are used in slots within
"ssBigBAF"
objects; one slot for each of the
big BAF and count surfaces. It is unlikely, but not
impossible that this class might be of use in casual application without the
link to big BAF sampling.
These classes are more
complex extensions of the sampSurf monte
class. These new classes are used for Monte Carlo subsampling from
objects of a subclass of “ssDoubleSampling”.
monteDoubleSampling | Virtual base class for the following |
monteBigBAF | Class structure for “Big BAF” sampling |
Note that these classes are not directly related though
inheritance to those in the “monte” class structure within the
standard sampSurf package. Because we are interested in several
different quantities such as basal area and volume on large and small
BAF sampling surfaces, and the comparison of different
variance estimators, much of the structure of the current
“monte”-type objects is in the form of lists of data frames,
rather than simple data frames as in the original sampSurf
implementation. Hence the use of inheritance was not
possible. However, it is possible to manually coerce the more complex
objects to the simpler structure (with some necessary loss of
information); see, for example, the hist
method below.
In additon, it is possible that some of the slots in the
"monteBigBAF
" subclass might migrate to the virtual
"monteDoubleSampling
"superclass in the future. This will not
change anything for the user. The plan for future
"monteDoubleSampling
" subclasses was not really considered at
the time of the coding for the current classes, therefore much of
what might end up being common slot-based functionality could be
moved eventually.
For each of the classes defined in the section above, we must be able to create objects that can be used in R. This is done using class-specific “constructor” (sometimes called “generator”) methods that take the drudgery away from creating what can be somewhat complicated new object instances. There may be more than one constructor for a given class of object, and these are differentiated by the method signature; see the links provided below for more details...
ssBigBAF | Constructor for individual “ssBigBAF” objects |
ssCellStemList | Constructor for individual “ssCellStemList” objects |
monte | Constructor for individual “monteDoubleSampling” subclass objects |
monteStatsBB | Calculate expanded point-wise statistics for individual Monte Carlo sample draws |
monteTreeStatsBB | Calculate unexpanded tree-wise statistics for individual Monte Carlo sample draws |
monteBootBB | Calculate jackknife and bootstrap samples on individual Monte Carlo replicates |
The objects created from the above classes have graphical
content made possible by using classes from the sp
or
raster
packages. Therefore, methods have been added to
the plot
generics to allow for graphical display of
objects. In addition, summary
and show
methods are also available (sometimes producing the same result) for
printing information within the object...
hist | Create a histogram of “monteBigBAF” results |
plot | To plot, e.g., a “ssBigBAF” object |
show | To succinctly print one of the objects |
summary | To summarize one of the objects |
showCells | Can be used with a number of different objects to plot a sample of grid cells (sample points) |
The following list a few methods that may be of some help in working with sampSurf and ssExtra...
initTract | Creates a simple
bufferedTract object for simulations |
drawTreePop | Creates a reasonable synthetic northern hardwoods tree population |
makePop | Creates a basic population for simulations on a “bufferedTract” using the above |
getTreesBB | Coerces a
standingTrees object to a data frame while adding
tree VBARs and basal area |
listCellStem | Handy routine to list the the sampling surface cell numbers within each tree's inclusion zone, and vice versa |
testBoot | Compare different bootstrap confidence intervals |
compareBoot | Compare sets of bootstrap confidence intervals |
createBBNH | Create an “ssBigBAF” object for the synthetic northern hardwood population |
pctDiff | Simple percent difference function |
ratioVariance | Used to calculate the ratio variance for the VBAR ratio |
Jeffrey H. Gove
Maintainer: Jeffrey H. Gove <jgove@fs.fed.us>
Gove, J. H., Gregoire,T. G., Ducey, M. J., and Lynch, T. B. 2020. A Note on the Estimation of Variance for Big BAF Sampling. Forest Ecosystems, Submitted.
Please see the sampSurf
package as well as the sp
and
raster
packages for details on the
underlying grid and polygon classes and methods.