Learn R Programming

APAtree (version 1.0.1)

apa_border_tree: Assess which trees in APA-maps are border trees.

Description

Border trees are trees whose APA-patches touch the plot-border.

Usage

apa_border_tree(apa_list)

Arguments

apa_list

A apa_list-object that was created with the [apa_list]-function.

Value

An apa_list where apa_list$tree_dat will have an additional column that specifies which trees are border trees.

Examples

Run this code
# NOT RUN {
library(APAtree)
data(tree_enrico, package = "APAtree")
data(plot_enrico, package = "APAtree")

# only calculate an apa_list for two plots and with a coarse resolution of 1 m
# to save time.
apa_list_enrico <- 
  apa_list(plot_dat = subset(plot_enrico, id_plot %in% c("5.2", "8.2")), 
           tree_dat = tree_enrico,
           plot_id_column = "id_plot",
           tree_id_column = "id_tree",
           weight_column = "crown_radius_95",
           res = 1,
           apa_polygon = TRUE)

apa_list_enrico <- apa_border_tree(apa_list_enrico)

# Information about which tree is a border tree is stored in the border_tree
# column
table(apa_list_enrico$tree_dat$border_tree)

# Plot border trees
plot(apa_list_enrico, 
     color_map = data.frame(border_tree = c(TRUE, FALSE), 
                                   color = c("red", gray(.9))),
     critical = NA)
# }

Run the code above in your browser using DataLab