#install.packages("remotes")
#remotes::install_github("forestgeo/allodb")
library(allodb)
library(ggplot2)
library(tidyverse)
#install.packages("formattable")
library(formattable)
#install.packages("kableExtra")
library(kableExtra)
library(readxl)
data <- read_excel("dbhtestforAGB.xlsx")
data$agb <-
get_biomass(
dbh = data$dbh,
genus = data$genus,
species = data$species,
coords = c(-76.62, 39.33) #generic coordinates used to represent all trees in olin forest
)
sum(data$agb)
## [1] 23505.41
data$Carbon<-round(data$agb*.48,1)
#Table
data_show <- data[, c(3:8, 11:12)] %>% #Showing relevant columns
head(30)
data_show %>%
kable("html", caption = 'Biomass and carbon (kilograms) prediction for sample of trees in Olin forest.') %>%
kable_styling()
| dbh | genus | species | Family | long | lat | agb | Carbon |
|---|---|---|---|---|---|---|---|
| 14.7 | Pinus | strobus | Pinaceae | -76.60000 | 39.30000 | 70.5406801 | 33.9 |
| 82.5 | Fagus | grandifolia | Fagaceae | -76.62420 | 39.32807 | 6158.2985707 | 2956.0 |
| 32.5 | Quercus | alba | Fagaceae | -76.62478 | 39.32888 | 744.1320788 | 357.2 |
| 62.0 | Fagus | grandifolia | Fagaceae | -76.62492 | 39.32919 | 3038.5347634 | 1458.5 |
| 2.0 | Ilex | opaca | Aquifoliaceae | -76.62472 | 39.32911 | 0.5541136 | 0.3 |
| 20.6 | Liriodendron | tulipifera | Magnoliaceae | -76.62466 | 39.32907 | 192.9447589 | 92.6 |
| 65.0 | Fagus | grandifolia | Fagaceae | -76.62392 | 39.33009 | 3415.1731825 | 1639.3 |
| 19.3 | Quercus | rubra | Fagaceae | -76.62400 | 39.33005 | 236.2479572 | 113.4 |
| 30.5 | Juglans | nigra | Juglandaceae | 76.62397 | 39.33000 | 527.1669912 | 253.0 |
| 9.8 | Ilex | opaca | Aquifoliaceae | -76.62390 | 39.33000 | 28.4374555 | 13.6 |
| 9.6 | Liriodendron | tulipifera | Magnoliaceae | -76.62406 | 39.33001 | 31.5801893 | 15.2 |
| 49.8 | Fagus | grandifolia | Fagaceae | -76.62000 | 39.33000 | 1767.4004581 | 848.4 |
| 94.1 | Liriodendron | tulipifera | Magnoliaceae | -76.62000 | 39.33000 | 7067.1644078 | 3392.2 |
| 4.4 | Fraxinus | americana | Oleaceae | -76.62000 | 39.33000 | 6.1505114 | 3.0 |
| 21.0 | Ilex | opaca | Aquifoliaceae | -76.62000 | 39.33000 | 187.9685621 | 90.2 |
| 10.7 | Magnolia | tripetala | Magnoliaceae | -76.62000 | 39.33000 | 33.1196333 | 15.9 |
#Picture from Olin forest