R/CohortMat.R
obsDF2arrays.Rd
Convert observation data frame to arrays
obsDF2arrays(obs_dt, additional_cols = character(0))
data.frame The observation data table containing siteID, patchID, cohortID, species, dbh, and trees columns.
character vector Optional. Additional columns to be included as arrays.
A list of arrays for species, dbh, trees, and additional columns.
obs_dt <- data.frame( siteID = c(1, 1, 2), patchID = c(1, 2, 1), cohortID = c(1, 1, 2), species = c(1, 2, 1), dbh = c(10, 20, 30), trees = c(100, 200, 150), height = c(5, 10, 15)) result <- obsDF2arrays(obs_dt, additional_cols = c("height"))