Title: | Tools for vegetation analysis |
---|---|
Description: | By now, just tools to calculate vegetation cover from field transects data. |
Authors: | Francisco Rodriguez-Sanchez [aut, cre] |
Maintainer: | Francisco Rodriguez-Sanchez <[email protected]> |
License: | GPL-3 |
Version: | 0.1.2 |
Built: | 2024-11-18 06:10:02 UTC |
Source: | https://github.com/Pakillo/vegetools |
Calculate total cover per species in each transect, layer within transect, etc. Optionally, the function can also calculate length of bare ground (as ground not covered by any plant species).
calculate_cover(df, split.cols, first.spcol, last.spcol = ncol(df), tr.length, bare = FALSE, precision, check.incremental = TRUE, sort.cols = TRUE, prop = FALSE, long.format = FALSE, show.progress = TRUE)
calculate_cover(df, split.cols, first.spcol, last.spcol = ncol(df), tr.length, bare = FALSE, precision, check.incremental = TRUE, sort.cols = TRUE, prop = FALSE, long.format = FALSE, show.progress = TRUE)
df |
A dataframe with one column per recorded species, plus additional columns to identify transects (and possibly sections within transects, shrub or tree layers, etc). For each species, introduce initial and ending distances every time the species appears along the transect (see example). |
split.cols |
A character vector with the names of the variables in |
first.spcol |
Integer. Number of the first column containing species cover data. |
last.spcol |
Integer. Number of the last column containing species cover data
(last column in |
tr.length |
Numeric. Total transect length (e.g. in meters). |
bare |
Logical. Calculate bare cover? Default is |
precision |
Numeric. Precision of species cover measurements. Only used to calculate bare cover by exclusion. |
check.incremental |
Logical (default is |
sort.cols |
Logical. If TRUE (default), sort species columns alphabetically (including bare as a species). |
prop |
Logical. If |
long.format |
Logical. Produce the output dataframe in long format? Default is wide format.
See |
show.progress |
Logical. Show progress bar? |
A dataframe with total cover values per species and transect (plus optionally bare ground).
F Rodriguez-Sanchez
df <- data.frame(transect = sort(rep(c(1,2,3), 20)), section = rep(1, 60), species1 = c(replicate(3, sort(round(runif(20, 0, 100), digits = 1)))), species2 = c(sort(round(runif(8, 0, 100), digits = 1)), rep(NA, times = 60 - 8))) head(df) calculate_cover(df, split.cols = "transect", first.spcol = 3, tr.length = 100, check.incremental = FALSE) calculate_cover(df, split.cols = "transect", first.spcol = 3, tr.length = 100, check.incremental = FALSE, long.format = TRUE)
df <- data.frame(transect = sort(rep(c(1,2,3), 20)), section = rep(1, 60), species1 = c(replicate(3, sort(round(runif(20, 0, 100), digits = 1)))), species2 = c(sort(round(runif(8, 0, 100), digits = 1)), rep(NA, times = 60 - 8))) head(df) calculate_cover(df, split.cols = "transect", first.spcol = 3, tr.length = 100, check.incremental = FALSE) calculate_cover(df, split.cols = "transect", first.spcol = 3, tr.length = 100, check.incremental = FALSE, long.format = TRUE)