copyLayers | R Documentation |
This function does not check the dimensions columns are identical. Any points in the 'from' object which are not in the 'to' object are ignored, and any points in the 'to' object which don't have corresponding points in the 'from' object are assigned NA, unless keep.all.to is set to FALSE .
copyLayers(
from,
to,
layer.names,
new.layer.names = NULL,
keep.all.to = TRUE,
keep.all.from = TRUE,
tolerance = NULL,
fill.dims = TRUE
)
from |
The Field/Comparison/data.table that the layers are to be copied from. |
to |
The Field/Comparison/data.table that the layers are to be copied to. |
layer.names |
The layers to be copied from the "from" argument |
new.layer.names |
The new names that the layers should have in the 'to' object. Use this to avoid naming conflict whereby, for example, if a layer "Total" is copied to an object which already has a "Total" layer then they layers will be names "Total.x" and "Total.y". |
keep.all.to |
Logical, if set to FALSE, all points in the 'to' object which don't have corresponding points in the 'from' object are removed. |
keep.all.from |
Logical, if set to FALSE, all points in the 'from' object which don't have corresponding points in the 'to' object are removed. |
tolerance |
Numeric, passed to copyLayers. Defines how close the longitudes and latitudes of the gridcells in |
fill.dims |
Logical, if TRUE (the default) and if the 'from' Field/data.table has less dimensions than the 'to' Field/data.table, then just fill in all the values of that dimension with the same data. Ie if if the 'from' table has no months but the to table does, just fill the same value into all months. |
This function allows layers (reminder, they are implemented as columns in a data.table) to be copied from one Field, Comaprison or data.table to another. This function is used extensively internally but can also be useful for user doing more advanced analysis and plotting. For example, is particularly useful for colouring or facetting a plot of one variable by another one. To give a more concrete example, one could use a biome classification to split (facet) a data-vs-model scatter plot.
A Field, Comparison or data.table comprising the 'to' object with the new layers added
Matthew Forrest matthew.forrest@senckenberg.de
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.