knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

Import and manipulate ForestGEO data

lifecycle Coverage status CRAN status R-CMD-check Codecov test coverage R-CMD-check

fgeo.tool helps you to import and manipulate ForestGEO data.

Installation

Install the latest stable version of fgeo.tool from CRAN with:

install.packages("fgeo.tool")

Install the development version of fgeo.tool from GitHub with:

# install.packages("devtools")
devtools::install_github("forestgeo/fgeo.tool")

Or install all fgeo packages in one step.

Example

library(fgeo.tool)
# Helps access data for examples
library(fgeo.x)

example_path() allows you to access datasets stored in your R libraries.

example_path()

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

read_vft() and read_taxa() import a ViewFullTable and ViewTaxonomy from .tsv or .csv files.

read_vft(vft_file)

pick_dbh_under(), drop_status() and friends pick and drop rows from a ForestGEO ViewFullTable or census table.

tree5 <- fgeo.x::tree5

tree5 %>% 
  pick_dbh_under(100)

pick_main_stem() and pick_main_stemid() pick the main stem or main stemid(s) of each tree in each census.

stem <- download_data("luquillo_stem6_random")

dim(stem)
dim(pick_main_stem(stem))

add_status_tree() adds the column status_tree based on the status of all stems of each tree.

stem %>% 
  select(CensusID, treeID, stemID, status) %>% 
  add_status_tree()

add_index() and friends add columns to a ForestGEO-like dataframe.

stem %>% 
  select(gx, gy) %>% 
  add_index()

Get started with fgeo

Information



forestgeo/fgeo.utils documentation built on Sept. 12, 2022, 6:12 p.m.