-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8bb29d
commit 8fec9b6
Showing
31 changed files
with
301 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#' Creation of an empty forest | ||
#' | ||
#' Creates an empty \code{\link{forest}} object. | ||
#' | ||
#' @param ntree,nshrub Number of tree and shrub cohorts, respectively. | ||
#' @param nseed Number of species in the seed bank. | ||
#' | ||
#' @return An empty \code{\link{forest}} object. | ||
#' | ||
#' @author Miquel De \enc{Cáceres}{Caceres} Ainsa, CREAF | ||
#' | ||
#' @seealso \code{\link{forest}}, \code{\link{tree2forest}}, \code{\link{summary.forest}}, \code{\link{forest_mapWoodyTables}}, \code{\link{forest_mergeTrees}}, | ||
#' \code{\link{plot.forest}} | ||
#' | ||
#' @examples | ||
#' # Initializes forest with 2 tree cohorts and 1 shrub cohort | ||
#' emptyforest(ntree = 2, nshrub = 1) | ||
#' | ||
#' @name emptyforest | ||
emptyforest <- function(ntree = 0, nshrub = 0, nseed = 0) { | ||
l <- list() | ||
l$treeData <- data.frame(Species=as.character(rep(NA, ntree)), | ||
DBH=as.numeric(rep(NA, ntree)), | ||
Height=as.numeric(rep(NA, ntree)), | ||
N=as.numeric(rep(NA, ntree)), | ||
Z50 = as.numeric(rep(NA, ntree)), | ||
Z95=as.numeric(rep(NA, ntree))) | ||
l$shrubData <- data.frame(Species=as.character(rep(NA, nshrub)), | ||
Height=as.numeric(rep(NA, nshrub)), | ||
Cover = as.numeric(rep(NA, nshrub)), | ||
Z50 = as.numeric(rep(NA, nshrub)), | ||
Z95=as.numeric(rep(NA, nshrub))) | ||
l$herbCover <- NA; | ||
l$herbHeight <- NA; | ||
l$seedBank <- data.frame(Species = as.character(rep(NA, nseed)), | ||
Percent = as.numeric(rep(NA, nseed))) | ||
class(l)<-c("forest","list") | ||
return(l) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.