fgeo installs and loads multiple R packages, functions, and datasets to analyze trees abundance, demography, and habitats (fgeo.abundance, fgeo.demography, fgeo.habitat). It also includes general-purpose functions to simplify the visualization (fgeo.map) and manipulation (fgeo.tool) of ForestGEO datasets (e.g. fgeo.data).
Quick search – click here to search by package, function, dataset, or help file.
Questions and Answers – click here to find answers to frequently asked questions about fgeo.
Install the pre-release version of fgeo:
# install.packages("devtools")
devtools::install_github("forestgeo/fgeo@pre-release")
Or install the development version of fgeo:
# install.packages("devtools")
devtools::install_github("forestgeo/fgeo")
For details on how to install packages from GitHub, see this article.
Load all fgeo packages in one step.
library(fgeo)
#> -- Attaching packages ---------------------------------------------- fgeo 0.0.0.9002 --
#> v fgeo.abundance 0.0.0.9005 v fgeo.habitat 0.0.0.9006
#> v fgeo.data 0.0.0.9005 v fgeo.map 0.0.0.9402
#> v fgeo.demography 0.0.0.9102 v fgeo.tool 0.0.0.9003
#>
Need help? Use fgeo_help()
to search every help file in the fgeo
package.
fgeo_help()
You can narrow down your search by using a keyword.
fgeo_help("datasets")
# Short name
stem <- luquillo_stem_1ha
# This dataset comes with multiple censuses.
unique(stem$CensusID)
#> [1] 1 2 3 4 5 6
stem
#> # A tibble: 72,582 x 19
#> treeID stemID tag StemTag sp quadrat gx gy MeasureID CensusID
#> <int> <int> <chr> <chr> <chr> <chr> <dbl> <dbl> <int> <int>
#> 1 46 46 1000~ 100001 PSYB~ 921 164. 416. 46 1
#> 2 47 47 1000~ 100002 PSYB~ 921 165. 416 47 1
#> 3 47 48 1000~ 100003 PSYB~ 921 165. 416 48 1
#> 4 47 49 1000~ 100004 PSYB~ 921 165. 416 49 1
#> 5 47 50 1000~ 100005 PSYB~ 921 165. 416 50 1
#> 6 47 51 1000~ 100006 PSYB~ 921 165. 416 51 1
#> 7 47 52 1000~ 100007 PSYB~ 921 165. 416 52 1
#> 8 47 53 1000~ 100008 PSYB~ 921 165. 416 53 1
#> 9 47 54 1000~ 100009 PSYB~ 921 165. 416 54 1
#> 10 47 55 1000~ 100010 PSYB~ 921 165. 416 55 1
#> # ... with 72,572 more rows, and 9 more variables: dbh <dbl>, pom <chr>,
#> # hom <dbl>, ExactDate <date>, DFstatus <chr>, codes <chr>,
#> # countPOM <dbl>, status <chr>, date <dbl>
Pick one census from the bottom (n < 0) rank of CensusID
.
stem6 <- pick_top(stem, var = CensusID, n = -1)
unique(stem6$CensusID)
#> [1] 6
Determine the status of each tree based on the status of each stem.
stem6 <- add_status_tree(stem6, status_a = "A", status_d = "D")
alive_trees <- subset(stem6, status_tree == "A")
# Note that alive trees may have some missing, gone or dead stems
some_cols <- c( "treeID", "status_tree", "stemID", "status")
example_tree <- 46
subset(alive_trees, treeID == example_tree, some_cols)
#> # A tibble: 2 x 4
#> treeID status_tree stemID status
#> <int> <chr> <int> <chr>
#> 1 46 A 46 D
#> 2 46 A 114033 G
Pick stems of 10 mm or more.
ten_plus <- pick_dbh_min(alive_trees, 10)
range(ten_plus$dbh, na.rm = TRUE)
#> [1] 10 1405
Count distinct values of stemID
and treeID
.
# Drop missing values of `dbh`
non_missing <- filter(ten_plus, !is.na(dbh))
# Stem abundance
abundance(non_missing)
#> Warning: `treeid`: Duplicated values were detected. Do you need to pick
#> main stems?
#> # A tibble: 1 x 1
#> n
#> <int>
#> 1 2564
# Tree abundance (picking main stems -- with highest `hom` and largest `dbh`)
largest_stem <- fgeo.tool::pick_main_stem(non_missing)
abundance(largest_stem)
#> # A tibble: 1 x 1
#> n
#> <int>
#> 1 2319
Count largest stems (unique treeID
s) by species.
by_sp <- group_by(largest_stem, sp)
abundance(by_sp)
#> # A tibble: 70 x 2
#> # Groups: sp [70]
#> sp n
#> <chr> <int>
#> 1 ALCFLO 11
#> 2 ALCLAT 15
#> 3 ANDINE 1
#> 4 ANTOBT 1
#> 5 ARDGLA 1
#> 6 BUCTET 11
#> 7 BYRSPI 25
#> 8 CALCAL 2
#> 9 CASARB 489
#> 10 CASSYL 58
#> # ... with 60 more rows
(Not maintained by ForestGEO)
-
CTFS-R Package: The original package of CTFS functions. No longer supported by ForestGEO.
-
BIOMASS: An R package to estimate above-ground biomass in tropical forests.
Data have been made available as required by the journal to enable reproduction of the results presented in the paper. Please do not share these data without permission of the ForestGEO plot Principal Investigators (PIs). If you wish to publish papers based on these data, you are also required to get permission from the PIs of the corresponding ForestGEO plots.
-
Soil drivers of local-scale tree growth in a lowland tropical forest (Zemunik et al., 2018).
-
-
Response #1: LaManna et al. 2018. Response to Comment on “Plant diversity increases with the strength of negative density dependence at the global scale” Science Vol. 360, Issue 6391, eaar3824. DOI: 10.1126/science.aar3824
-
Response #2: LaManna et al. 2018. Response to Comment on “Plant diversity increases with the strength of negative density dependence at the global scale”. Science Vol. 360, Issue 6391, eaar5245. DOI: 10.1126/science.aar5245
-
Thanks to all partners of ForestGEO for sharing their ideas and code. For feedback on fgeo, special thanks to Gabriel Arellano, Stuart Davies, Lauren Krizel, Sean McMahon, and Haley Overstreet. There are many other people that deserve special acknowledgements; I thank them in the documentation and home page of each individual package that make up the fgeo development.