Tract: Generate Objects of Class "'Tract'"

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This generic function has methods based on the signature formal argument object. It is used as a constructor function for objects that are of class "Tract". This method should be used in preference to new to insure a valid object.

Usage

1
Tract(object, ...)

Arguments

object

This is the signature formal argument, see the methods for more details.

...

Formal arguments that are different for each method, see those for details.

Details

There is no default generic function for Tract per se. It is defined completely with respect to the signature of its methods Tract-methods. Methods are available for several useful signatures, such as objects of class "RasterLayer", allowing for a large variety of ways to generate objects of this class. Other methods can obviously be added for other signatures as necessary.

Value

A valid object of class "Tract."

Author(s)

Jeffrey H. Gove

See Also

Tract-methods

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
tract = Tract(c(x=20,y=20), cellSize=0.25)    #extents constructor
tr = Tract(,0.5, c(x=20,y=20),c(0.25,0.25),units='metric') #missing constructor
tr2 = Tract(cellSize=0.5, cellDims=c(x=20,y=20), cellCenter=c(0.25,0.25),
            units='metric') #same constructor as the previous
tr.ext = Tract(c(x=10,y=15), cellSize=0.5) #maximal extent constructor
#bounding box constructor...
bb = bbox(tr.ext)
bb[,1] = c(5,4)
tr3 = Tract(bb, 0.5)
#RasterLayer constructor...
ex = extent(tr3)
rl = raster(ex, nrow=10, ncols=10, crs=NA)
## Not run: 
tr4 = Tract(rl)  #error: non-square grid cells

## End(Not run)
rl = raster(ex, nrow=22, ncol=10, crs=NA)
tr4 = Tract(rl)  #okay, square cells

sampSurf documentation built on March 5, 2021, 3:01 p.m.