knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(itcfuns) library(tidyverse)
plot_coords <- read_csv(system.file("extdata/plot_coords.csv", package = "itcfuns")) plot_coords
stem_mapped_polar <- read_csv(system.file("extdata/stem_mapped_polar.csv", package = "itcfuns")) stem_mapped_polar
Join plot center coordinates
stem_mapped_polar <- inner_join(stem_mapped_polar, plot_coords, by = c("plotID" = "PlotID"))
stem_mapped_XY <- stem_mapped_polar %>% mutate(polar_to_XY(Azimuth, Distance, XPLOT, YPLOT, CrownOffsetAzimuth, CrownOffsetDistance, crs = 26910))
detected_trees <- read_csv(system.file("extdata/detected_trees.csv", package = "itcfuns")) detected_trees
# Clean mapped_trees data frame mapped_trees <- stem_mapped_XY %>% select(!c(XPLOT, YPLOT, Azimuth:CrownOffsetDistance)) %>% relocate(Z, SpeciesAbbrev, .after = Y) detected_trees nn_trees <- match_nn_trees(mapped_trees = mapped_trees, detected_trees = detected_trees, distance_type = "3D") nn_trees
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.