knitr::opts_chunk$set(
  collapse = TRUE,
  eval = TRUE,
  comment = "#>",
  fig.show = "hold",
  fig.align = "center",
  out.width = "70%", 
  fig.width = 9.5, 
  fig.asp = 0.7
)

options(fgeo.quiet = TRUE)

fgeo is a collection of R packages to analyze forest diversity and dynamics. We plan to announce it widely in early 2019. Before that, we would love you to give us some feedback, and report issues.

This post highlights the main features. For more details please see the Example and Reference sections.

Setup

To install fgeo see Installation. To use fgeo run library(fgeo) in R.

library(fgeo)

All fgeo packages are now attached.

search()

Explore fgeo

Use fgeo_help() to search documentation. It is similar to utils::help.search() but specific for fgeo.

Access and manipulate data

fgeo comes with small datasets for examples. When you use fgeo you can also use many datasets directly.

tree5

Other datasets are stored in R's library. You can access them with example_path().

example_path("rdata")

dir(example_path("rdata"))

Larger datasets live online. You can download them with download_data().

download_data("luquillo_tree5_random")

Use read_vft() to read your own ViewFullTable. Compared to utils::read.csv() it is easier to use and safer.

(viewfulltable_file <- example_path("view/vft_4quad.csv"))

read_vft(viewfulltable_file)

Plot

# Using only two species to keep the example small
two_species <-  c("PREMON", "CASARB")

# The pipe operator (`%>%`) can make your code easier to read
census <- download_data("luquillo_stem6_random") %>% 
  filter(sp %in% two_species)

Use autoplot() to plot different classes of ForestGEO data. For example:

class(sp(census))

autoplot(sp(census))
# Using `data()` just for clarity
data("habitat")

class(habitat)

autoplot(habitat)

Analyze

The available analyses include abundance, mortality, and species-habitat association.

census %>% 
  pick_main_stem() %>% 
  group_by(sp) %>% 
  abundance()
data("tree5")
data("tree6")

as_tibble(
  mortality_ctfs(tree5, tree6)
)
tree <- download_data("luquillo_tree5_random")
data("habitat")

summary(
  tt_test(tree, habitat)
)

Get started with fgeo



forestgeo/fgeo documentation built on Dec. 24, 2019, 8:07 p.m.