aRTtable-createAndFillColumn {aRT} | R Documentation |
Creates and fills a column
Description
Create a new column in a table of a cellular layer,
filling it with the result of a spatial operation, which can also involve
some attribute.
Usage
## S4 method for signature 'aRTtable':
createAndFillColumn(object, newatt="", target, strategy=
c("average", "stdev", "sum", "minimum", "maximum", "majority", "distance", "xdistance", "count", "presence", "area", "length", "averagewba", "sumwba", "percentage", "weighbra"), geometry=c("point", "line", "polygon", "raster"), att="", proportion=FALSE, itime="", ftime="", dist=50, raster=NULL, validValues=NULL, band=NULL)
Arguments
object |
Object of class aRTtable . |
newatt |
The name of the new column. |
target |
An aRTraster or aRTtheme object. |
strategy |
The way to calculate the attribute of each cell:
- average: Average of an attribute of the objects that have some intersection with the cell, without taking into account their geometric properties.
- stdev: Standard deviation of an attribute of the objects that have some intersection with the cell, without taking into account their geometric properties.
- sum: Sum of an attribute of the objects that have some intersection with the cell, without taking into account their geometric properties.
- minimum: Minimum value of an attribute among the objects that have some intersection with the cell, without taking into account their geometric properties.
- maximum: Maximum value of an attribute among the objects that have some intersection with the cell, without taking into account their geometric properties.
- majority: More common value in the objects that have some intersection with the cell, without taking into account their geometric properties.
- distance: Distance to the nearest object of a chosen geometry (requires argument geometry).
- xdistance: Approximated distance to the nearest object of a chosen geometry (requires arguments geometry and dist).
- count: Number of objects that have some overlay with the cell (requires argument geometry).
- presence: Boolean value pointing out whether some object has an overlay with the cell.
- area: Total area of overlay between the cell and the layer of polygons.
- length: Total length of overlay between the cell and the layer of lines.
- averagewba: Average weighted by area, based on the proportion of the intersection area. Useful when you want to distribute atributes that represent averages, such as per capita income.
- sumwba: Sum weighted by area, based on the proportion of the intersection area. Useful when you want to preserve the total amount in both layers, such as population size.
- percentage: Percentages of each class of a raster data. It creates one attribute for each class of the raster.
- weighbra: ???
|
geometry |
The geometry to compute the attribute. One of "point", "polygon", "line", "raster". |
att |
The atribute used to compute the new column. It is only required when the strategy uses an attribute (such as average, sum, etc.) |
proportion |
Whether the calculation will be based on the intersection area, or the weights are equal for each object whth some overlap. |
itime |
The initial time (for temporal tables). |
ftime |
The final time (for temporal tables). |
dist |
The maximum error when calculating the distance. |
raster |
An object of class aRTraster , used only in the strategy “weighbra”. |
validValues |
A set of valid raster values, used only in the strategy “weighbra”. The other values are ignored. |
band |
An integer value representing the band of the raster to be used. This argument is used only in the strategy “weighbra”. |
Author(s)
Pedro Ribeiro de Andrade
See Also
See aRTtable-class
to show the description of this class. See createLayer
to know how to
create a layer of cells.
[Package
aRT version 1.7-1
Index]