create_nci_files | R Documentation |
function to create the files needed to estimate NCI-growth equations using the anneal function of the likelihood package.
create_nci_files( df, dbh, sp, x, y, self_del = T, ..., min.target.dbh = NULL, min.neighbor.dbh = NULL, max.neighbor.radius = NULL )
df |
the data frame containing information about the target trees. |
dbh |
variable in 'df' that contains the diameter of the trees. |
sp |
variable in 'df' that contains the specific identity of trees |
x |
variable in 'df' that contains the X coordinate of the trees. Coordinates can be referred to any reference point (typically they will refer to either one of the plot corners or the plot center), but all of them must be referred to the same point to allow calculating distances between trees. |
y |
variable in 'df' that contains the Y coordinate of the trees. Coordinates can be referred to any reference point (typically they will refer to either one of the plot corners or the plot center), but all of them must be referred to the same point to allow calculating distances between trees. #' |
self_del |
If 'TRUE', a tree is not included as a neighbor of itself. If 'FALSE' the attribute if the target tree will be also included in the output as a neighbor of itself. |
... |
optional. Character or numeric variable that identifies the plots, or experimental units, within which the neighbors will be considered. This information is used to split the calculations per plot, and the results are merged back into a single data frame. A tree 'b' will not be considered as a neighbor of tree 'a' unless they belong to the same plot. If this argument is missing, all trees in 'df' will be considered both targets and neighbors. |
min.target.dbh |
numeric The minimum dbh for a tree to be considered as a target. The function will only return neighbors of those target trees with dbh >= min.target.dbh. If not specified, all trees in 'df' will be considered targets |
min.neighbor.dbh |
numeric The minimum dbh for a tree to be considered as a neighbor. All those neighbors of a given target with dbh above this threshold will be ignored. If not specified, all the neighbors of a given target will be considered |
max.neighbor.radius |
numeric maximum radius to search for neighbors. Only those neighbors located closer than this distance from a target tree will be considered their neighbors. |
create_nci_files
a list containing three data frames with the values of dbh, species and distance to target tree for each neighbor tree. Each data frame will contain as many rows as target trees, and as many columns as the maximum number of neighbors per tree.Missing values are coded as 'NA'.
data(tree_data) files <- create_nci_files(tree_data, dbh = dbh, sp = sps,x = x, y = y, plot) # add some restrictions on target size and searching distance files2 <- create_nci_files(tree_data, dbh, sp, x, y, self_del = T, plot, min.target.dbh = 100, min.neighbor.dbh = 20, max.neighbor.radius = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.