growth_ex {forestecology} | R Documentation |
Example growth data frame for small example
Description
This is an example growth data frame formed from two census data frames. In this case it is made by combining census_1_ex and census_2_ex. The individuals alive in both censuses were linked by their tree ID.
Usage
growth_ex
Format
A sf
spatial tibble
- ID
Tree identification number. This identifies an individual tree and can be used to connect trees between the two censuses.
- sp
Species of the individual
- codes1
Code for additional information on the stem during the first census: M means the main stem of the individual tree and R means the stem was lost, but the tag was moved to another stem greater than DBH cutoff, this stands for resprout.
- dbh1
Diameter at breast height of the tree in cm at the first census
- dbh2
Diameter at breast height of the tree in cm at the second census
- growth
Average annual growth between the two censuses in cm per year
- codes2
Codes at the second census
- geometry
Point location of the individual
See Also
Other example data objects:
blocks_ex
,
census_1_ex
,
census_2008_bw
,
census_2014_bw
,
census_2_ex
,
comp_bayes_lm_ex
,
focal_vs_comp_ex
,
growth_spatial_ex
,
growth_toy
,
species_bw
,
study_region_bw
,
study_region_ex
Examples
library(ggplot2)
library(dplyr)
library(sf)
library(sfheaders)
library(blockCV)
growth_ex %>%
ggplot() +
geom_sf()
growth_ex %>%
group_by(sp) %>%
summarize(mean(growth))
# Add buffer
growth_spatial_ex <- growth_ex %>%
add_buffer_variable(direction = "in", size = 1, region = study_region_ex)
# Add cross-validation folds
fold1 <- rbind(c(0, 0), c(5, 0), c(5, 5), c(0, 5), c(0, 0))
fold2 <- rbind(c(5, 0), c(10, 0), c(10, 5), c(5, 5), c(5, 0))
blocks <- bind_rows(
sf_polygon(fold1),
sf_polygon(fold2)
) %>%
mutate(foldID = c(1, 2))
SpatialBlock_ex <- spatialBlock(
speciesData = growth_ex,
verbose = FALSE,
k = 2,
selection = "systematic",
blocks = blocks
)
# Add foldID to data
growth_spatial_ex <- growth_spatial_ex %>%
mutate(foldID = SpatialBlock_ex$foldID %>% as.factor())