R 패키지 메타데이터와 수집 신호를 모아 봅니다.
첫 화면에서 판단해야 할 수집 신호를 먼저 배치합니다.
DESCRIPTION에서 감지한 backend 관련 package입니다.
기본 메타데이터를 작은 카드와 토큰으로 압축합니다.
RcppRcppArmadilloBHlefko3| Package | Type | Spec |
|---|---|---|
| grDevices CRAN · 2.0.7 · 2026-05-30 | Imports | grDevices |
| lefko3 CRAN · 2.0.7 · 2026-05-30 | Imports | lefko3 |
| methods CRAN · 2.0.7 · 2026-05-30 | Imports | methods |
| Rcpp CRAN · 2.0.7 · 2026-05-30 | Imports | Rcpp (>= 1.0.12) |
| rlang CRAN · 2.0.7 · 2026-05-30 | Imports | rlang |
| stats CRAN · 2.0.7 · 2026-05-30 | Imports | stats |
| BH CRAN · 2.0.7 · 2026-05-30 | LinkingTo | BH |
| lefko3 CRAN · 2.0.7 · 2026-05-30 | LinkingTo | lefko3 |
| Rcpp CRAN · 2.0.7 · 2026-05-30 | LinkingTo | Rcpp |
| RcppArmadillo CRAN · 2.0.7 · 2026-05-30 | LinkingTo | RcppArmadillo |
| knitr CRAN · 2.0.7 · 2026-05-30 | Suggests | knitr |
| rmarkdown CRAN · 2.0.7 · 2026-05-30 | Suggests | rmarkdown |
| testthat CRAN · 2.0.7 · 2026-05-30 | Suggests | testthat |
| 검색 결과가 없습니다. | ||
| Package | Type | Spec |
|---|---|---|
| 표시할 dependency edge가 없습니다. | ||
| 검색 결과가 없습니다. | ||
NEWS code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} span.underline{text-decoration: underline;} div.column{display: inline-block; vertical-align: top; width: 50%;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} adapt3 2.0.7 (2026-02-12) NEW FEATURES A benchmark option has been added to functions project3(), invade3(), and batch_project3(). Unit tests added. BUG FIXES Processing of age-related parameters in batch projection of Leslie MPMs fixed. Processing of supplements in batch_project3() no longer leads to an occasional memory leak. adapt3 2.0.0 (2026-02-09) NEW FEATURES Trait axes now include individual covariate values that can be used to create variants. Density dependence through the additive limit and absolute limit functions has been added to projection and invasion functions. Equivalence frames and density frames can now be added per annual matrix. Community projections with projection3() can now handle post-processing of pre-existing MPMs with argument supplemental . Function batch_project3() now runs batches of community projections using vectors of alterations input as matrix element offsets, given rate changes, and multipliers. Function summary.adaptProjBatch() now summarizes batch community projections. Function project3() now includes aggregate density in the output. Function summary.adaptProj() now also outputs mean final population sizes for each MPM across replicates. Function plot.adaptInv() now processes the first variable trait in the trait axis as the source of axis labels by default to PIPs, and to the x axis in elasticity plots. USER-VISIBLE CHANGES The output list structure for function project3() has changed, with item comm_out renamed to structure , and with its own structure changing such that the top-level list refers to replicates, and the lower-level list refers to input MPMs. BUGS FIXED Projection via vrm_input with deviance terms now no longer crashes. Function project3() no longer always incorporates the current MPMs start vector as the vector at time 0, but instead incorporates it only as the correct start time. Corrected issue resulting in Leslie-format function-based MPMs yielding matrices full of NAs if the format vector is missing. Fixed fatal error in project3() occurring when the number of MPMs entered is smaller than the times projected using unequal stage weights across MPMs. Fixed bug that led function summary.adaptProj() to acknowledge only a single replicate. adapt3 1.0.2 (2025-08-27) NEW FEATURES ESS trait value optimization now handled via Golden section Nelder-Mead search algorithm. Standard error bootstrapping example added to invasibility analysis vignette. USER-VISIBLE CHANGES Corrections to documentation. Corrected default axis labels in function plot.adaptInv(). BUGS FIXED Corrected optimization trait axis calculations in cases where traits span both positive and negative values. Corrected ESS trait value calculations in cases where traits span both positive and negative values. Function plot.adaptInv() now correctly labels axes with user-supplied values. Function summary.adaptInv() now gives the correct number of variants tested. adapt3 1.0.1 (2025-07-11) USER-VISIBLE CHANGES Corrections to documentation. adapt3 1.0.0 (2025-07-10) NEW FEATURES New community projection vignette. USER-VISIBLE CHANGES Corrected help files for certain functions. adapt3 0.9.9 (2025-07-08) USER-VISIBLE CHANGES Invasibility analysis vignette fully created. BUGS FIXED Function invade3() now correctly subsets converged trait optima rows. adapt 0.9.8 (2025-07-07) NEW FEATURES Functions plot.adaptInv() and summary.adaptInv() created to plot and summarize invasibility analyses, respectively. adapt3 0.9.7 (2025-07-05) NEW FEATURES Functions plot.adaptProj() and summary.adaptProj() created to plot and summarize community projections, respectively. ESS optimization routine enabled for function invade3(). New invasibility analysis vignette added. Threshold values for 0s created for function invade3(). adapt3 0.9.6 (2025-04-12) NEW FEATURES Function invade3() added to run invasibility analyses. Function plot.adaptInv() created to plot the results of pairwise invasibility analyses. Functions ta_skeletion() and trait_axis() created to develop quick trait axis data frames. adapt3 0.9.5 (2025-03-09) NEW FEATURES Full project3() function developed. First full pre-invasion version. USER-VISIBLE CHANGES Updated error messages. adapt3 0.9.3 (2025-02-19) USER-VISIBLE CHANGES Underlying functions adapted to newest LefkoUtils. adapt3 0.9.2 (2024-05-12) NEW FEATURES Function project3() split up to allow creation of main invasion functions. adapt3 0.9.1 (2024-05-02) NEW FEATURES Cypripedium parviflorum dataset added. adapt3 0.9 (2024-04-28) NEW FEATURES First development version. Core function addyn_proj() function and accessory function equiv_input() developed.Help for package adapt3 const macros = { "\\R": "\\textsf{R}", "\\mbox": "\\text", "\\code": "\\texttt"}; function processMathHTML() { var l = document.getElementsByClassName('reqn'); for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); } return; } Package {adapt3} Contents adapt3-package batch_project3 cypa_data equiv_input invade3 plot.adaptInv plot.adaptProj project3 summary.adaptInv summary.adaptProj summary.adaptProjBatch ta_skeleton trait_axis Type: Package Title: Adaptive Dynamics and Community Matrix Model Projections Version: 2.0.7 Date: 2026-02-12 Description: Runs projections of groups of matrix projection models (MPMs), allowing density dependence mechanisms to work across MPMs. This package was developed to run both adaptive dynamics simulations such as pairwise and multiple invasibility analyses, and community projections in which species are represented by MPMs. All forms of MPMs are allowed, including integral projection models (IPMs). Encoding: UTF-8 License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] URL: https://github.com/dormancy1/adapt3 Imports: Rcpp (≥ 1.0.12), lefko3, methods, rlang, grDevices, stats LinkingTo: Rcpp, RcppArmadillo, BH, lefko3 LazyData: true BugReports: https://github.com/dormancy1/adapt3/issues RoxygenNote: 7.3.3 Suggests: knitr, rmarkdown, testthat VignetteBuilder: knitr, rmarkdown NeedsCompilation: yes Packaged: 2026-02-12 11:07:13 UTC; richpshefferson Author: Richard P. Shefferson [aut, cre] Maintainer: Richard P. Shefferson <cdorm@g.ecc.u-tokyo.ac.jp> Depends: R (≥ 3.5.0) Repository: CRAN Date/Publication: 2026-02-13 10:00:02 UTC Adaptive Dynamics and Community Matrix Model Projections Description Runs projections of groups of matrix projection models (MPMs), allowing density dependence mechanisms to work across MPMs. This package was developed to run both adaptive dynamics simulations such as pairwise and multiple invasion analysis, and community projections in which species are represented by MPMs. All forms of MPMs are allowed, including integral projection models (IPMs). Details The adapt3 package provides three categories of functions: 1. Core projection 2. Function characterizing relationships among MPMs 3. Functions describing, summarizing, or visualizing results adapt3 also includes example datasets complete with sample code. Author(s) Maintainer : Richard P. Shefferson cdorm@g.ecc.u-tokyo.ac.jp ( ORCID ) Richard P. Shefferson <cdorm@g.ecc.u-tokyo.ac.jp> References Pending See Also Useful links: https://github.com/dormancy1/adapt3 Report bugs at https://github.com/dormancy1/adapt3/issues Project Multiple MPMs In Batches With Varying Starting Conditions Description Function batch_project3 runs function project3() across series of differing beginning conditions. Currently used to run sensitivity analyses. Usage batch_project3( used_mpms = NULL, givenrate = NULL, offset = NULL, multiplier = NULL, all_elems = NULL, mpms = NULL, vrms = NULL, stageframes = NULL, supplements = NULL, equivalence = NULL, starts = NULL, years = NULL, patches = NULL, tweights = NULL, format = NULL, entry_time = NULL, sp_density = NULL, ind_terms = NULL, dev_terms = NULL, fb_sparse = NULL, firstage = NULL, finalage = NULL, fecage_min = NULL, fecage_max = NULL, cont = NULL, fecmod = NULL, density = NULL, density_vr = NULL, err_check = NULL, benchmark = NULL, stochastic = FALSE, integeronly = FALSE, substoch = 0L, nreps = 1L, times = 10000L, prep_mats = 20L, force_fb = FALSE, exp_tol = 700, theta_tol = 1e+08 ) Arguments used_mpms An integer vector detailing the MPMs entered in argument mpms to run the batch projection on. Although all MPMs entered in argument mpms will be projected, the alterations given in givenrate , offset , or multiplier will only be performed with those specified here. Defaults to "all" , which is equivalent to an integer vector holding the sequence of 1 through the number of MPMs entered. givenrate A numeric vector giving values to replace targeted matrix elements with. If used, then arguments offset and multiplier cannot be used. Defaults to NULL . offset A numeric vector giving the values to offset matrix elements by. If used, then arguments givenrate and multiplier cannot be used. Defaults to c(0.005, 0.010, 0.015, 0.020, 0.025) . multiplier A numeric vector giving values to multiply targeted matrix elements by. If used, then arguments givenrate and offset cannot be used. Defaults to NULL . all_elems A logical value indicating whether to use the alterations specified in argument givenrate , offset , or multiplier on all matrix elements. Defaults to FALSE . mpms An optional list of MPMs. Each MPM must be of class lefkoMat . vrms An optional list of vrm_input objects, each corresponding to a distinct MPM that will be created during projection. Each vrm_input object requires its own stageframe, entered in the same order via argument stageframes . stageframes An optional list of stageframes, corresponding in number and order to the MPMs in argument vrms . Each stageframe must be of class stageframe . supplements An optional list of data frames of class lefkoSD that provide supplemental data that should be incorporated into MPMs. If used, then should have the same number of elements as the number of MPMs provided in the list for argument vrms , with MPMs that do not need supplemental data entered as NULL elements in this list. See supplemental () for details of how these data frames are used in function-based MPM construction. equivalence An optional numeric vector, list of numeric vectors, data frame of class adaptEq or class lefkoEq , or a list of such data frames. If a numeric vector, then must have the same number of elements as the number of MPMs, with each element giving the effect of an individual of each MPM relative to a reference individual. If a list of vectors, then the list should be composed of as many numeric vectors as MPMs, or as a two- layered list of such vectors for each annual matrix per MPM, with each vector giving the effect of each individual in each stage relative to a reference individual. Data frames of class adaptEq , and lists of such data frames, can be made with function equiv_input () . Numeric entries used in these vectors can be thought of as Lotka-Volterra competition terms, such as are used in multiple species competition models. starts An optional list of lefkoSV objects, which are data frames providing the starting numbers of individuals of each stage. If provided, then one is needed per MPM. If not provided, then all projections start with a single individual of each stage per MPM. years An optional term corresponding either to a single integer vector of time t values, if all MPMs will use the same time t or set of time t 's, or a list of such vectors with each vector corresponding to each MPM in order. In the latter case, a vector composed of a single NA value is interpreted to mean that all time t values in the MPM should be utilized. If a vector shorter than times is supplied, then this vector will be cycled. patches An optional string vector with length equal to the number of MPMs, detailing the name of each patch to project for each MPM, in order. Only a single pop-patch may be projected for each MPM given. A value of NA can be supplied to indicate that the population-level matrices should be projected (if argument mpms is used and a population-level set of matrices exist), or that the first patch noted should be used. Defaults to the population-level set or the first patch, depending on whether the former exists. tweights An optional list composed of numeric vectors or matrices denoting the probabilities of choosing each matrix in each MPM in a stochastic projection. If an element of the list is a matrix, then a first-order Markovian environment is assumed, in which the probability of choosing a specific annual matrix depends on which annual matrix is currently chosen. If an element of the list is a vector, then the choice of aRuns projections of groups of matrix projection models (MPMs), allowing density dependence mechanisms to work across MPMs. This package was developed to run both adaptive dynamics simulations such as pairwise and multiple invasion analysis, and community projections in which species are represented by MPMs. All forms of MPMs are allowed, including integral projection models (IPMs).
Function batch_project3 runs function project3() across series of differing beginning conditions. Currently used to run sensitivity analyses.
batch_project3( used_mpms = NULL, givenrate = NULL, offset = NULL, multiplier = NULL, all_elems = NULL, mpms = NULL, vrms = NULL, stageframes = NULL, supplements = NULL, equivalence = NULL, starts = NULL, years = NULL, patches = NULL, tweights = NULL, format = NULL, entry_time = NULL, sp_density = NULL, ind_terms = NULL, dev_terms = NULL, fb_sparse = NULL, firstage = NULL, finalage = NULL, fecage_min = NULL, fecage_max = NULL, cont = NULL, fecmod = NULL, density = NULL, density_vr = NULL, err_check = NULL, benchmark = NULL, stochastic = FALSE, integeronly = FALSE, substoch = 0L, nreps = 1L, times = 10000L, prep_mats = 20L, force_fb = FALSE, exp_tol = 700, theta_tol = 1e+08 )library(lefko3) data(cypdata) sizevector <- c(0, 0, 0, 0, 0, 0, 1, 2.5, 4.5, 8, 17.5) stagevector <- c("SD", "P1", "P2", "P3", "SL", "D", "XSm", "Sm", "Md", "Lg", "XLg") repvector <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1) obsvector <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1) matvector <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1) immvector <- c(0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0) propvector <- c(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) indataset <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1) binvec <- c(0, 0, 0, 0, 0, 0.5, 0.5, 1, 1, 2.5, 7) cypframe_raw <- sf_create(sizes = sizevector, stagenames = stagevector, repstatus = repvector, obsstatus = obsvector, matstatus = matvector, propstatus = propvector, immstatus = immvector, indataset = indataset, binhalfwidth = binvec) sizevector <- c(0, 0, 3.0, 15) stagevector <- c("P1", "D", "Sm", "Lg") repvector <- c(0, 0, 1, 1) obsvector <- c(0, 0, 1, 1) matvector <- c(0, 1, 1, 1) immvector <- c(1, 0, 0, 0) indataset <- c(0, 1, 1, 1) binvec <- c(0, 0.5, 2.5, 9.5) cypframe_small_raw <- sf_create(sizes = sizevector, stagenames = stagevector, repstatus = repvector, obsstatus = obsvector, matstatus = matvector, immstatus = immvector, indataset = indataset, binhalfwidth = binvec) cypraw_v1 <- verticalize3(data = cypdata, noyears = 6, firstyear = 2004, patchidcol = "patch", individcol = "plantid", blocksize = 4, sizeacol = "Inf2.04", sizebcol = "Inf.04", sizeccol = "Veg.04", repstracol = "Inf.04", repstrbcol = "Inf2.04", fecacol = "Pod.04", stageassign = cypframe_raw, stagesize = "sizeadded", NAas0 = TRUE, NRasRep = TRUE) cypraw_v2 <- verticalize3(data = cypdata, noyears = 6, firstyear = 2004, patchidcol = "patch", individcol = "plantid", blocksize = 4, sizeacol = "Inf2.04", sizebcol = "Inf.04", sizeccol = "Veg.04", repstracol = "Inf.04", repstrbcol = "Inf2.04", fecacol = "Pod.04", stageassign = cypframe_small_raw, stagesize = "sizeadded", NAas0 = TRUE, NRasRep = TRUE) cypraw_v3 <- verticalize3(data = cypdata, noyears = 6, firstyear = 2004, patchidcol = "patch", individcol = "plantid", blocksize = 4, sizeacol = "Inf2.04", sizebcol = "Inf.04", sizeccol = "Veg.04", repstracol = "Inf.04", repstrbcol = "Inf2.04", fecacol = "Pod.04", NAas0 = TRUE, NRasRep = TRUE) cypsupp2r <- supplemental(stage3 = c("SD", "P1", "P2", "P3", "SL", "D", "XSm", "Sm", "SD", "P1"), stage2 = c("SD", "SD", "P1", "P2", "P3", "SL", "SL", "SL", "rep", "rep"), eststage3 = c(NA, NA, NA, NA, NA, "D", "XSm", "Sm", NA, NA), eststage2 = c(NA, NA, NA, NA, NA, "XSm", "XSm", "XSm", NA, NA), givenrate = c(0.10, 0.20, 0.20, 0.20, 0.25, NA, NA, NA, NA, NA), multiplier = c(NA, NA, NA, NA, NA, NA, NA, NA, 1500, 500), type =c(1, 1, 1, 1, 1, 1, 1, 1, 3, 3), stageframe = cypframe_raw, historical = FALSE) cypmatrix2r <- rlefko2(data = cypraw_v1, stageframe = cypframe_raw, year = "all", patch = "all", stages = c("stage3", "stage2", "stage1"), size = c("size3added", "size2added"), supplement = cypsupp2r, yearcol = "year2", patchcol = "patchid", indivcol = "individ") cypmean <- lmean(cypmatrix2r) cypsupp2r_small <- supplemental(stage3 = c("D", "Sm", "Lg", "P1"), stage2 = c("P1", "P1", "P1", "rep"), eststage3 = c(NA, "Sm", "Lg", NA), eststage2 = c(NA, "D", "D", NA), givenrate = c(0.05, NA, NA, NA), offset = c(NA, NA, -0.1, NA), multiplier = c(NA, NA, NA, 0.5), type =c(1, 1, 1, 3), stageframe = cypframe_small_raw, historical = FALSE) cypmatrix2r_small <- rlefko2(data = cypraw_v2, stageframe = cypframe_small_raw, year = "all", patch = "all", stages = c("stage3", "stage2", "stage1"), size = c("size3added", "size2added"), supplement = cypsupp2r_small, yearcol = "year2", patchcol = "patchid", indivcol = "individ") cypmean_small <- lmean(cypmatrix2r_small) cypmatrixL_small <- rleslie(data = cypraw_v3, start_age = 1, last_age = 4, continue = TRUE, fecage_min = 3, year = "all", pop = NA, patch = "all", yearcol = "year2", patchcol = "patchid", indivcol = "individ") cyp_mpms1 <- list(cypmatrix2r, cypmatrix2r_small, cypmatrixL_small) c2d_4 <- density_input(cypmean, stage3 = c("P1", "P1"), stage2= c("SD", "rep"), style = 1, time_delay = 1, alpha = 1, beta = 0.0005, type = c(2, 2)) c2d_4a <- density_input(cypmean_small, stage3 = c("P1", "P1"), stage2= c("P1", "rep"), style = 1, time_delay = 1, alpha = 1, beta = 0.0005, type = c(2, 2)) cypL_dv <- density_input(cypmatrixL_small, stage3 = c("Age1"), stage2 = c("rep"), style = c(1), alpha = c(0.5), beta = c(1.0), type = c(2)) cyp_density <- list(c2d_4, c2d_4a, cypL_dv) cyp_start1 <- start_input(cypmatrix2r, stage2 = c("SD", "P1", "D"), value = c(100, 200, 4)) cyp_start2 <- start_input(cypmatrix2r_small, stage2 = c("P1", "D"), value = c(10, 2000)) cypL_start_1 <- start_input(cypmatrixL_small, stage2 = c("Age1"), value = c(200)) cyp_start <- list(cyp_start1, cyp_start2, cypL_start_1) new_supplement_cyp2_small <- sup_skeleton(2) new_supplement_cyp2_small$stage3 <- c("D", "Sm") new_supplement_cyp2_small$stage2 <- c("Lg", "Lg") new_supplement_cyp2_small$convtype <- c(1, 1) used_supplements <- list(new_supplement_cyp2_small, new_supplement_cyp2_small, NULL) aaa1_prj_batch2 <- batch_project3(used_mpms = "all", all_elems = FALSE, mpms = cyp_mpms1, entry_time = c(0, 5, 8), times = 15, nreps = 3, supplement = used_supplements, integeronly = TRUE, density = cyp_density)A dataset containing the states and fates of a population of the terrestrial orchid species Cypripedium parviflorum (small yellow lady's slipper orchids) in Illinois, USA. The dataset resulted from annual monitoring from 1994 and 2011.
data(cypa_data)Shefferson, R.P., R. Mizuta, and M.J. Hutchings. 2017. Predicting evolution in response to climate change: the example of sprouting probability in three dormancy-prone orchid species. Royal Society Open Science 4(1):160647.library(lefko3) data(cypa_data) sizevector <- c(0, 0, 0, 0, 0, 0, 1, 2.5, 4.5, 8, 17.5) stagevector <- c("SD", "P1", "P2", "P3", "SL", "D", "XSm", "Sm", "Md", "Lg", "XLg") repvector <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1) obsvector <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1) matvector <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1) immvector <- c(0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0) propvector <- c(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) indataset <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1) binvec <- c(0, 0, 0, 0, 0, 0.5, 0.5, 1, 1, 2.5, 7) cypframe_raw <- sf_create(sizes = sizevector, stagenames = stagevector, repstatus = repvector, obsstatus = obsvector, matstatus = matvector, propstatus = propvector, immstatus = immvector, indataset = indataset, binhalfwidth = binvec) cypraw_v1 <- verticalize3(data = cypa_data, noyears = 18, firstyear = 1994, individcol = "plant_id", blocksize = 2, sizeacol = "Inf.94", sizebcol = "Veg.94", repstracol = "Inf.94", fecacol = "Inf.94", stageassign = cypframe_raw, stagesize = "sizeadded", NAas0 = TRUE, NRasRep = TRUE) cypsupp2r <- supplemental(stage3 = c("SD", "P1", "P2", "P3", "SL", "D", "XSm", "Sm", "SD", "P1"), stage2 = c("SD", "SD", "P1", "P2", "P3", "SL", "SL", "SL", "rep", "rep"), eststage3 = c(NA, NA, NA, NA, NA, "D", "XSm", "Sm", NA, NA), eststage2 = c(NA, NA, NA, NA, NA, "XSm", "XSm", "XSm", NA, NA), givenrate = c(0.10, 0.20, 0.20, 0.20, 0.25, NA, NA, NA, NA, NA), multiplier = c(NA, NA, NA, NA, NA, NA, NA, NA, 0.5, 0.5), type =c(1, 1, 1, 1, 1, 1, 1, 1, 3, 3), stageframe = cypframe_raw, historical = FALSE) cypmatrix2r <- rlefko2(data = cypraw_v1, stageframe = cypframe_raw, year = "all", stages = c("stage3", "stage2", "stage1"), size = c("size3added", "size2added"), supplement = cypsupp2r, yearcol = "year2", indivcol = "individ") lambda3(cypmatrix2r)Function equiv_input() creates a data frame summarizing the weighting of individuals of different species, populations, and stages relative to one another in terms of the overall community size or population size. Equivalance values can be thought of as Lotka-Volterra coefficients.
equiv_input(mpm, stage2 = NA, stage1 = NA, age2 = NA, value = 1)library(lefko3) data(cypdata) data(cypa_data) sizevector <- c(0, 0, 0, 0, 0, 0, 1, 2.5, 4.5, 8, 17.5) stagevector <- c("SD", "P1", "P2", "P3", "SL", "D", "XSm", "Sm", "Md", "Lg", "XLg") repvector <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1) obsvector <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1) matvector <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1) immvector <- c(0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0) propvector <- c(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) indataset <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1) binvec <- c(0, 0, 0, 0, 0, 0.5, 0.5, 1, 1, 2.5, 7) cypframe_raw <- sf_create(sizes = sizevector, stagenames = stagevector, repstatus = repvector, obsstatus = obsvector, matstatus = matvector, propstatus = propvector, immstatus = immvector, indataset = indataset, binhalfwidth = binvec) cycaraw_v1 <- verticalize3(data = cypdata, noyears = 6, firstyear = 2004, patchidcol = "patch", individcol = "plantid", blocksize = 4, sizeacol = "Inf2.04", sizebcol = "Inf.04", sizeccol = "Veg.04", repstracol = "Inf.04", repstrbcol = "Inf2.04", fecacol = "Pod.04", stageassign = cypframe_raw, stagesize = "sizeadded", NAas0 = TRUE, NRasRep = TRUE) cyparaw_v1 <- verticalize3(data = cypa_data, noyears = 18, firstyear = 1994, individcol = "plant_id", blocksize = 2, sizeacol = "Inf.94", sizebcol = "Veg.94", repstracol = "Inf.94", fecacol = "Inf.94", stageassign = cypframe_raw, stagesize = "sizeadded", NAas0 = TRUE, NRasRep = TRUE) cypsupp2r <- supplemental(stage3 = c("SD", "P1", "P2", "P3", "SL", "D", "XSm", "Sm", "SD", "P1"), stage2 = c("SD", "SD", "P1", "P2", "P3", "SL", "SL", "SL", "rep", "rep"), eststage3 = c(NA, NA, NA, NA, NA, "D", "XSm", "Sm", NA, NA), eststage2 = c(NA, NA, NA, NA, NA, "XSm", "XSm", "XSm", NA, NA), givenrate = c(0.10, 0.20, 0.20, 0.20, 0.25, NA, NA, NA, NA, NA), multiplier = c(NA, NA, NA, NA, NA, NA, NA, NA, 0.5, 0.5), type =c(1, 1, 1, 1, 1, 1, 1, 1, 3, 3), stageframe = cypframe_raw, historical = FALSE) cyp_supp_list1 <- list(cypsupp2r, cypsupp2r) cycamatrix2r <- rlefko2(data = cycaraw_v1, stageframe = cypframe_raw, year = "all", patch = "all", stages = c("stage3", "stage2", "stage1"), size = c("size3added", "size2added"), supplement = cypsupp2r, yearcol = "year2", patchcol = "patchid", indivcol = "individ") cypamatrix2r <- rlefko2(data = cyparaw_v1, stageframe = cypframe_raw, year = "all", stages = c("stage3", "stage2", "stage1"), size = c("size3added", "size2added"), supplement = cypsupp2r, yearcol = "year2", patchcol = "patchid", indivcol = "individ") cyp_mpm_list <- list(cycamatrix2r, cypamatrix2r) cyca2_start <- start_input(cycamatrix2r, stage2 = c("SD", "P1", "P2"), value = c(500, 100, 200)) cypa2_start <- start_input(cypamatrix2r, stage2 = c("SD", "P1", "P2"), value = c(5000, 1000, 2000)) cyp_start_list <- list(cyca2_start, cypa2_start) cyp2_dv <- density_input(cypamatrix2r, stage3 = c("SD", "P1"), stage2 = c("rep", "rep"), style = c(1, 1), alpha = c(0.5, 1.2), beta = c(1.0, 2.0), type = c(2, 1)) cyp_dv_list <- list(cyp2_dv, cyp2_dv) cyp_eq <- equiv_input(cycamatrix2r, stage2 = c("SD", "P1", "SL", "D", "XSm", "Sm", "Md", "Lg", "XLg"), value = c(0, 1, 1, 1, 1, 1, 1, 1, 1)) eq_list <- list(cyp_eq, cyp_eq) cyp_comm_proj <- project3(mpms = cyp_mpm_list, starts = cyp_start_list, density = cyp_dv_list, times = 10) summary(cyp_comm_proj)Function invade3 runs pairwise and multiple invasisibility analyses, and provides output to analyze all aspects of the dynamics of generic variants. The output includes invasion fitness for all variants included, as well as resident fitness in all simulations run. Forms the core data plotted by the plot.adaptInv() function to plot pairwise invasibility plots (PIPs) and elasticity plots. Also estimates trait optima, if any occur.
invade3( axis = NULL, mpm = NULL, vrm = NULL, stageframe = NULL, supplement = NULL, equivalence = NULL, starts = NULL, years = NULL, patches = NULL, tweights = NULL, format = NULL, entry_time = NULL, sp_density = NULL, ind_terms = NULL, dev_terms = NULL, fb_sparse = NULL, firstage = NULL, finalage = NULL, fecage_min = NULL, fecage_max = NULL, cont = NULL, prebreeding = NULL, fecmod = NULL, density = NULL, density_vr = NULL, stochastic = NULL, A_only = NULL, integeronly = NULL, fitness_table = NULL, trait_optima = NULL, zap_min = NULL, converged_only = NULL, err_check = NULL, benchmark = NULL, var_per_run = 2L, substoch = 0L, elast_mult = 0.995, nreps = 1L, times = 10000L, fitness_times = 100L, exp_tol = 700, theta_tol = 1e+08, threshold = 1e-08, loop_max = 150L )library(lefko3) data(cypdata) sizevector <- c(0, 0, 0, 0, 1, 2.5, 4.5, 8, 17.5) stagevector <- c("SD", "P1", "SL", "D", "XSm", "Sm", "Md", "Lg", "XLg") repvector <- c(0, 0, 0, 0, 1, 1, 1, 1, 1) obsvector <- c(0, 0, 0, 0, 1, 1, 1, 1, 1) matvector <- c(0, 0, 0, 1, 1, 1, 1, 1, 1) immvector <- c(0, 1, 1, 0, 0, 0, 0, 0, 0) propvector <- c(1, 0, 0, 0, 0, 0, 0, 0, 0) indataset <- c(0, 0, 0, 1, 1, 1, 1, 1, 1) binvec <- c(0, 0, 0, 0.5, 0.5, 1, 1, 2.5, 7) cypframe_raw <- sf_create(sizes = sizevector, stagenames = stagevector, repstatus = repvector, obsstatus = obsvector, matstatus = matvector, propstatus = propvector, immstatus = immvector, indataset = indataset, binhalfwidth = binvec) cypraw_v1 <- verticalize3(data = cypdata, noyears = 6, firstyear = 2004, patchidcol = "patch", individcol = "plantid", blocksize = 4, sizeacol = "Inf2.04", sizebcol = "Inf.04", sizeccol = "Veg.04", repstracol = "Inf.04", repstrbcol = "Inf2.04", fecacol = "Pod.04", stageassign = cypframe_raw, stagesize = "sizeadded", NAas0 = TRUE, NRasRep = TRUE) cypsupp2r <- supplemental(stage3 = c("SD", "P1", "SL", "D", "XSm", "Sm", "SD", "P1"), stage2 = c("SD", "SD", "P1", "SL", "SL", "SL", "rep", "rep"), eststage3 = c(NA, NA, NA, "D", "XSm", "Sm", NA, NA), eststage2 = c(NA, NA, NA, "XSm", "XSm", "XSm", NA, NA), givenrate = c(0.10, 0.40, 0.25, NA, NA, NA, NA, NA), multiplier = c(NA, NA, NA, NA, NA, NA, 1000, 1000), type =c(1, 1, 1, 1, 1, 1, 3, 3), stageframe = cypframe_raw, historical = FALSE) cypmatrix2r <- rlefko2(data = cypraw_v1, stageframe = cypframe_raw, year = "all", patch = "all", stages = c("stage3", "stage2", "stage1"), size = c("size3added", "size2added"), supplement = cypsupp2r, yearcol = "year2", patchcol = "patchid", indivcol = "individ") cypmean <- lmean(cypmatrix2r) cyp_start <- start_input(cypmean, stage2 = c("SD", "P1", "D"), value = c(1000, 200, 4)) c2d_4 <- density_input(cypmean, stage3 = c("P1", "P1"), stage2= c("SD", "rep"), style = 2, time_delay = 1, alpha = 0.005, beta = 0.000005, type = c(2, 2)) # A simple projection allows us to find a combination of density dependence # and running time that produces a stable quasi-equilibrium cyp_proj <- projection3(cypmean, times = 250, start_frame = cyp_start, density = c2d_4, integeronly = TRUE) plot(cyp_proj) cyp_ta <- trait_axis(stageframe = cypframe_raw, stage3 = rep("P1", 15), stage2 = rep("rep", 15), multiplier = seq(from = 0.1, to = 10.0, length.out = 15), type = rep(2, 15)) cyp_inv <- invade3(axis = cyp_ta, mpm = cypmean, density = c2d_4, times = 350, starts = cyp_start, entry_time = c(0, 250), fitness_times = 30, var_per_run = 2) plot(cyp_inv)Function plot.adaptInv plots pairwise invasibility contour plots, diagnostic population plots, and elasticity plot. This function is based on code derived from Roff's Modeling Evolution: An Introduction to Numerical Methods (2010, Oxford University Press).
plotadaptInv( x, res_variant = 1, inv_variant = 2, repl = 1, pip = TRUE, elast = FALSE, run = 1, filled = TRUE, plot.title, plot.axes, axes = TRUE, frame.plot = TRUE, auto_ylim = TRUE, auto_col = TRUE, auto_lty = TRUE, auto_title = FALSE, auto_axis = FALSE, auto_axis_ticks = 5, ... )library(lefko3) data(cypdata) sizevector <- c(0, 0, 0, 0, 1, 2.5, 4.5, 8, 17.5) stagevector <- c("SD", "P1", "SL", "D", "XSm", "Sm", "Md", "Lg", "XLg") repvector <- c(0, 0, 0, 0, 1, 1, 1, 1, 1) obsvector <- c(0, 0, 0, 0, 1, 1, 1, 1, 1) matvector <- c(0, 0, 0, 1, 1, 1, 1, 1, 1) immvector <- c(0, 1, 1, 0, 0, 0, 0, 0, 0) propvector <- c(1, 0, 0, 0, 0, 0, 0, 0, 0) indataset <- c(0, 0, 0, 1, 1, 1, 1, 1, 1) binvec <- c(0, 0, 0, 0.5, 0.5, 1, 1, 2.5, 7) cypframe_raw <- sf_create(sizes = sizevector, stagenames = stagevector, repstatus = repvector, obsstatus = obsvector, matstatus = matvector, propstatus = propvector, immstatus = immvector, indataset = indataset, binhalfwidth = binvec) cypraw_v1 <- verticalize3(data = cypdata, noyears = 6, firstyear = 2004, patchidcol = "patch", individcol = "plantid", blocksize = 4, sizeacol = "Inf2.04", sizebcol = "Inf.04", sizeccol = "Veg.04", repstracol = "Inf.04", repstrbcol = "Inf2.04", fecacol = "Pod.04", stageassign = cypframe_raw, stagesize = "sizeadded", NAas0 = TRUE, NRasRep = TRUE) cypsupp2r <- supplemental(stage3 = c("SD", "P1", "SL", "D", "XSm", "Sm", "SD", "P1"), stage2 = c("SD", "SD", "P1", "SL", "SL", "SL", "rep", "rep"), eststage3 = c(NA, NA, NA, "D", "XSm", "Sm", NA, NA), eststage2 = c(NA, NA, NA, "XSm", "XSm", "XSm", NA, NA), givenrate = c(0.10, 0.40, 0.25, NA, NA, NA, NA, NA), multiplier = c(NA, NA, NA, NA, NA, NA, 1000, 1000), type =c(1, 1, 1, 1, 1, 1, 3, 3), stageframe = cypframe_raw, historical = FALSE) cypmatrix2r <- rlefko2(data = cypraw_v1, stageframe = cypframe_raw, year = "all", patch = "all", stages = c("stage3", "stage2", "stage1"), size = c("size3added", "size2added"), supplement = cypsupp2r, yearcol = "year2", patchcol = "patchid", indivcol = "individ") cypmean <- lmean(cypmatrix2r) cyp_start <- start_input(cypmean, stage2 = c("SD", "P1", "D"), value = c(1000, 200, 4)) c2d_4 <- density_input(cypmean, stage3 = c("P1", "P1"), stage2= c("SD", "rep"), style = 2, time_delay = 1, alpha = 0.005, beta = 0.000005, type = c(2, 2)) # A simple projection allows us to find a combination of density dependence # and running time that produces a stable quasi-equilibrium cyp_proj <- projection3(cypmean, times = 250, start_frame = cyp_start, density = c2d_4, integeronly = TRUE) plot(cyp_proj) cyp_ta <- trait_axis(stageframe = cypframe_raw, stage3 = rep("P1", 15), stage2 = rep("rep", 15), multiplier = seq(from = 0.1, to = 10.0, length.out = 15), type = rep(2, 15)) cyp_inv <- invade3(axis = cyp_ta, mpm = cypmean, density = c2d_4, times = 350, starts = cyp_start, entry_time = c(0, 250), fitness_times = 30, var_per_run = 2) plot(cyp_inv)Function plot.adaptProj plots community projections.
plotadaptProj( x, repl = 1, agg_only = FALSE, auto_ylim = TRUE, auto_col = TRUE, auto_lty = TRUE, auto_lwd = TRUE, auto_title = FALSE, ... )library(lefko3) data(cypdata) data(cypa_data) sizevector <- c(0, 0, 0, 0, 0, 0, 1, 2.5, 4.5, 8, 17.5) stagevector <- c("SD", "P1", "P2", "P3", "SL", "D", "XSm", "Sm", "Md", "Lg", "XLg") repvector <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1) obsvector <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1) matvector <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1) immvector <- c(0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0) propvector <- c(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) indataset <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1) binvec <- c(0, 0, 0, 0, 0, 0.5, 0.5, 1, 1, 2.5, 7) cypframe_raw <- sf_create(sizes = sizevector, stagenames = stagevector, repstatus = repvector, obsstatus = obsvector, matstatus = matvector, propstatus = propvector, immstatus = immvector, indataset = indataset, binhalfwidth = binvec) cycaraw_v1 <- verticalize3(data = cypdata, noyears = 6, firstyear = 2004, patchidcol = "patch", individcol = "plantid", blocksize = 4, sizeacol = "Inf2.04", sizebcol = "Inf.04", sizeccol = "Veg.04", repstracol = "Inf.04", repstrbcol = "Inf2.04", fecacol = "Pod.04", stageassign = cypframe_raw, stagesize = "sizeadded", NAas0 = TRUE, NRasRep = TRUE) cyparaw_v1 <- verticalize3(data = cypa_data, noyears = 18, firstyear = 1994, individcol = "plant_id", blocksize = 2, sizeacol = "Inf.94", sizebcol = "Veg.94", repstracol = "Inf.94", fecacol = "Inf.94", stageassign = cypframe_raw, stagesize = "sizeadded", NAas0 = TRUE, NRasRep = TRUE) cypsupp2r <- supplemental(stage3 = c("SD", "P1", "P2", "P3", "SL", "D", "XSm", "Sm", "SD", "P1"), stage2 = c("SD", "SD", "P1", "P2", "P3", "SL", "SL", "SL", "rep", "rep"), eststage3 = c(NA, NA, NA, NA, NA, "D", "XSm", "Sm", NA, NA), eststage2 = c(NA, NA, NA, NA, NA, "XSm", "XSm", "XSm", NA, NA), givenrate = c(0.10, 0.20, 0.20, 0.20, 0.25, NA, NA, NA, NA, NA), multiplier = c(NA, NA, NA, NA, NA, NA, NA, NA, 0.5, 0.5), type =c(1, 1, 1, 1, 1, 1, 1, 1, 3, 3), stageframe = cypframe_raw, historical = FALSE) cyp_supp_list1 <- list(cypsupp2r, cypsupp2r) cycamatrix2r <- rlefko2(data = cycaraw_v1, stageframe = cypframe_raw, year = "all", stages = c("stage3", "stage2", "stage1"), size = c("size3added", "size2added"), supplement = cypsupp2r, yearcol = "year2", indivcol = "individ") cypamatrix2r <- rlefko2(data = cyparaw_v1, stageframe = cypframe_raw, year = "all", stages = c("stage3", "stage2", "stage1"), size = c("size3added", "size2added"), supplement = cypsupp2r, yearcol = "year2", indivcol = "individ") cyp_mpm_list <- list(cycamatrix2r, cypamatrix2r) cyca2_start <- start_input(cycamatrix2r, stage2 = c("SD", "P1", "P2"), value = c(500, 100, 200)) cypa2_start <- start_input(cypamatrix2r, stage2 = c("SD", "P1", "P2"), value = c(5000, 1000, 2000)) cyp_start_list <- list(cyca2_start, cypa2_start) cyp2_dv <- density_input(cypamatrix2r, stage3 = c("SD", "P1"), stage2 = c("rep", "rep"), style = c(1, 1), alpha = c(0.5, 1.2), beta = c(1.0, 2.0), type = c(2, 1)) cyp_dv_list <- list(cyp2_dv, cyp2_dv) cyp_comm_proj <- project3(mpms = cyp_mpm_list, starts = cyp_start_list, density = cyp_dv_list, times = 10) plot(cyp_comm_proj, lwd = 2, bty = "n")Function project3 uses pre-existing or function-based MPMs to run community projection simulations, in which different populations are run as separate MPMs. Density dependence can be used with individual equivalence vectors specifying Lotka-Volterra coefficients to adjust overall population sizes to make them comparable.
project3( mpms = NULL, vrms = NULL, stageframes = NULL, supplements = NULL, equivalence = NULL, starts = NULL, years = NULL, patches = NULL, tweights = NULL, format = NULL, entry_time = NULL, sp_density = NULL, ind_terms = NULL, dev_terms = NULL, fb_sparse = NULL, firstage = NULL, finalage = NULL, fecage_min = NULL, fecage_max = NULL, cont = NULL, fecmod = NULL, density = NULL, density_vr = NULL, err_check = NULL, benchmark = NULL, stochastic = FALSE, integeronly = FALSE, substoch = 0L, nreps = 1L, times = 10000L, prep_mats = 20L, force_fb = FALSE, exp_tol = 700, theta_tol = 1e+08 )library(lefko3) data(cypdata) data(cypa_data) sizevector <- c(0, 0, 0, 0, 0, 0, 1, 2.5, 4.5, 8, 17.5) stagevector <- c("SD", "P1", "P2", "P3", "SL", "D", "XSm", "Sm", "Md", "Lg", "XLg") repvector <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1) obsvector <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1) matvector <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1) immvector <- c(0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0) propvector <- c(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) indataset <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1) binvec <- c(0, 0, 0, 0, 0, 0.5, 0.5, 1, 1, 2.5, 7) cypframe_raw <- sf_create(sizes = sizevector, stagenames = stagevector, repstatus = repvector, obsstatus = obsvector, matstatus = matvector, propstatus = propvector, immstatus = immvector, indataset = indataset, binhalfwidth = binvec) cycaraw_v1 <- verticalize3(data = cypdata, noyears = 6, firstyear = 2004, patchidcol = "patch", individcol = "plantid", blocksize = 4, sizeacol = "Inf2.04", sizebcol = "Inf.04", sizeccol = "Veg.04", repstracol = "Inf.04", repstrbcol = "Inf2.04", fecacol = "Pod.04", stageassign = cypframe_raw, stagesize = "sizeadded", NAas0 = TRUE, NRasRep = TRUE) cyparaw_v1 <- verticalize3(data = cypa_data, noyears = 18, firstyear = 1994, individcol = "plant_id", blocksize = 2, sizeacol = "Inf.94", sizebcol = "Veg.94", repstracol = "Inf.94", fecacol = "Inf.94", stageassign = cypframe_raw, stagesize = "sizeadded", NAas0 = TRUE, NRasRep = TRUE) cypsupp2r <- supplemental(stage3 = c("SD", "P1", "P2", "P3", "SL", "D", "XSm", "Sm", "SD", "P1"), stage2 = c("SD", "SD", "P1", "P2", "P3", "SL", "SL", "SL", "rep", "rep"), eststage3 = c(NA, NA, NA, NA, NA, "D", "XSm", "Sm", NA, NA), eststage2 = c(NA, NA, NA, NA, NA, "XSm", "XSm", "XSm", NA, NA), givenrate = c(0.10, 0.20, 0.20, 0.20, 0.25, NA, NA, NA, NA, NA), multiplier = c(NA, NA, NA, NA, NA, NA, NA, NA, 0.5, 0.5), type =c(1, 1, 1, 1, 1, 1, 1, 1, 3, 3), stageframe = cypframe_raw, historical = FALSE) cyp_supp_list1 <- list(cypsupp2r, cypsupp2r) cycamatrix2r <- rlefko2(data = cycaraw_v1, stageframe = cypframe_raw, year = "all", patch = "all", stages = c("stage3", "stage2", "stage1"), size = c("size3added", "size2added"), supplement = cypsupp2r, yearcol = "year2", patchcol = "patchid", indivcol = "individ") cypamatrix2r <- rlefko2(data = cyparaw_v1, stageframe = cypframe_raw, year = "all", stages = c("stage3", "stage2", "stage1"), size = c("size3added", "size2added"), supplement = cypsupp2r, yearcol = "year2", patchcol = "patchid", indivcol = "individ") cyp_mpm_list <- list(cycamatrix2r, cypamatrix2r) cyca2_start <- start_input(cycamatrix2r, stage2 = c("SD", "P1", "P2"), value = c(500, 100, 200)) cypa2_start <- start_input(cypamatrix2r, stage2 = c("SD", "P1", "P2"), value = c(5000, 1000, 2000)) cyp_start_list <- list(cyca2_start, cypa2_start) cyp2_dv <- density_input(cypamatrix2r, stage3 = c("SD", "P1"), stage2 = c("rep", "rep"), style = c(1, 1), alpha = c(0.5, 1.2), beta = c(1.0, 2.0), type = c(2, 1)) cyp_dv_list <- list(cyp2_dv, cyp2_dv) cyp_comm_proj <- project3(mpms = cyp_mpm_list, starts = cyp_start_list, density = cyp_dv_list, times = 10) summary(cyp_comm_proj)Function summary.adaptInv() summarizes adaptInv objects.
summaryadaptInv(object, ...)library(lefko3) data(cypdata) sizevector <- c(0, 0, 0, 0, 1, 2.5, 4.5, 8, 17.5) stagevector <- c("SD", "P1", "SL", "D", "XSm", "Sm", "Md", "Lg", "XLg") repvector <- c(0, 0, 0, 0, 1, 1, 1, 1, 1) obsvector <- c(0, 0, 0, 0, 1, 1, 1, 1, 1) matvector <- c(0, 0, 0, 1, 1, 1, 1, 1, 1) immvector <- c(0, 1, 1, 0, 0, 0, 0, 0, 0) propvector <- c(1, 0, 0, 0, 0, 0, 0, 0, 0) indataset <- c(0, 0, 0, 1, 1, 1, 1, 1, 1) binvec <- c(0, 0, 0, 0.5, 0.5, 1, 1, 2.5, 7) cypframe_raw <- sf_create(sizes = sizevector, stagenames = stagevector, repstatus = repvector, obsstatus = obsvector, matstatus = matvector, propstatus = propvector, immstatus = immvector, indataset = indataset, binhalfwidth = binvec) cypraw_v1 <- verticalize3(data = cypdata, noyears = 6, firstyear = 2004, patchidcol = "patch", individcol = "plantid", blocksize = 4, sizeacol = "Inf2.04", sizebcol = "Inf.04", sizeccol = "Veg.04", repstracol = "Inf.04", repstrbcol = "Inf2.04", fecacol = "Pod.04", stageassign = cypframe_raw, stagesize = "sizeadded", NAas0 = TRUE, NRasRep = TRUE) cypsupp2r <- supplemental(stage3 = c("SD", "P1", "SL", "D", "XSm", "Sm", "SD", "P1"), stage2 = c("SD", "SD", "P1", "SL", "SL", "SL", "rep", "rep"), eststage3 = c(NA, NA, NA, "D", "XSm", "Sm", NA, NA), eststage2 = c(NA, NA, NA, "XSm", "XSm", "XSm", NA, NA), givenrate = c(0.10, 0.40, 0.25, NA, NA, NA, NA, NA), multiplier = c(NA, NA, NA, NA, NA, NA, 1000, 1000), type =c(1, 1, 1, 1, 1, 1, 3, 3), stageframe = cypframe_raw, historical = FALSE) cypmatrix2r <- rlefko2(data = cypraw_v1, stageframe = cypframe_raw, year = "all", patch = "all", stages = c("stage3", "stage2", "stage1"), size = c("size3added", "size2added"), supplement = cypsupp2r, yearcol = "year2", patchcol = "patchid", indivcol = "individ") cypmean <- lmean(cypmatrix2r) cyp_start <- start_input(cypmean, stage2 = c("SD", "P1", "D"), value = c(1000, 200, 4)) c2d_4 <- density_input(cypmean, stage3 = c("P1", "P1"), stage2= c("SD", "rep"), style = 2, time_delay = 1, alpha = 0.005, beta = 0.000005, type = c(2, 2)) # A simple projection allows us to find a combination of density dependence # and running time that produces a stable quasi-equilibrium cyp_proj <- projection3(cypmean, times = 250, start_frame = cyp_start, density = c2d_4, integeronly = TRUE) plot(cyp_proj) cyp_ta <- trait_axis(stageframe = cypframe_raw, stage3 = rep("P1", 15), stage2 = rep("rep", 15), multiplier = seq(from = 0.1, to = 10.0, length.out = 15), type = rep(2, 15)) cyp_inv <- invade3(axis = cyp_ta, mpm = cypmean, density = c2d_4, times = 350, starts = cyp_start, entry_time = c(0, 250), fitness_times = 30, var_per_run = 2) summary(cyp_inv)Function summary.adaptProj() summarizes adaptProj objects.
summaryadaptProj( object, threshold = 1, inf_alive = TRUE, milepost = c(0, 0.25, 0.5, 0.75, 1), ext_time = FALSE, finalN_mean = FALSE, finalN_used = 100, ... )library(lefko3) data(cypdata) data(cypa_data) sizevector <- c(0, 0, 0, 0, 0, 0, 1, 2.5, 4.5, 8, 17.5) stagevector <- c("SD", "P1", "P2", "P3", "SL", "D", "XSm", "Sm", "Md", "Lg", "XLg") repvector <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1) obsvector <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1) matvector <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1) immvector <- c(0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0) propvector <- c(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) indataset <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1) binvec <- c(0, 0, 0, 0, 0, 0.5, 0.5, 1, 1, 2.5, 7) cypframe_raw <- sf_create(sizes = sizevector, stagenames = stagevector, repstatus = repvector, obsstatus = obsvector, matstatus = matvector, propstatus = propvector, immstatus = immvector, indataset = indataset, binhalfwidth = binvec) cycaraw_v1 <- verticalize3(data = cypdata, noyears = 6, firstyear = 2004, patchidcol = "patch", individcol = "plantid", blocksize = 4, sizeacol = "Inf2.04", sizebcol = "Inf.04", sizeccol = "Veg.04", repstracol = "Inf.04", repstrbcol = "Inf2.04", fecacol = "Pod.04", stageassign = cypframe_raw, stagesize = "sizeadded", NAas0 = TRUE, NRasRep = TRUE) cyparaw_v1 <- verticalize3(data = cypa_data, noyears = 18, firstyear = 1994, individcol = "plant_id", blocksize = 2, sizeacol = "Inf.94", sizebcol = "Veg.94", repstracol = "Inf.94", fecacol = "Inf.94", stageassign = cypframe_raw, stagesize = "sizeadded", NAas0 = TRUE, NRasRep = TRUE) cypsupp2r <- supplemental(stage3 = c("SD", "P1", "P2", "P3", "SL", "D", "XSm", "Sm", "SD", "P1"), stage2 = c("SD", "SD", "P1", "P2", "P3", "SL", "SL", "SL", "rep", "rep"), eststage3 = c(NA, NA, NA, NA, NA, "D", "XSm", "Sm", NA, NA), eststage2 = c(NA, NA, NA, NA, NA, "XSm", "XSm", "XSm", NA, NA), givenrate = c(0.10, 0.20, 0.20, 0.20, 0.25, NA, NA, NA, NA, NA), multiplier = c(NA, NA, NA, NA, NA, NA, NA, NA, 0.5, 0.5), type =c(1, 1, 1, 1, 1, 1, 1, 1, 3, 3), stageframe = cypframe_raw, historical = FALSE) cyp_supp_list1 <- list(cypsupp2r, cypsupp2r) cycamatrix2r <- rlefko2(data = cycaraw_v1, stageframe = cypframe_raw, year = "all", stages = c("stage3", "stage2", "stage1"), size = c("size3added", "size2added"), supplement = cypsupp2r, yearcol = "year2", indivcol = "individ") cypamatrix2r <- rlefko2(data = cyparaw_v1, stageframe = cypframe_raw, year = "all", stages = c("stage3", "stage2", "stage1"), size = c("size3added", "size2added"), supplement = cypsupp2r, yearcol = "year2", indivcol = "individ") cyp_mpm_list <- list(cycamatrix2r, cypamatrix2r) cyca2_start <- start_input(cycamatrix2r, stage2 = c("SD", "P1", "P2"), value = c(500, 100, 200)) cypa2_start <- start_input(cypamatrix2r, stage2 = c("SD", "P1", "P2"), value = c(5000, 1000, 2000)) cyp_start_list <- list(cyca2_start, cypa2_start) cyp2_dv <- density_input(cypamatrix2r, stage3 = c("SD", "P1"), stage2 = c("rep", "rep"), style = c(1, 1), alpha = c(0.5, 1.2), beta = c(1.0, 2.0), type = c(2, 1)) cyp_dv_list <- list(cyp2_dv, cyp2_dv) cyp_comm_proj <- project3(mpms = cyp_mpm_list, starts = cyp_start_list, density = cyp_dv_list, times = 10) summary(cyp_comm_proj)Function summary.adaptProjBatch() summarizes adaptProjBatch objects.
summaryadaptProjBatch( object, finalN_mean = FALSE, finalN_used = 100, threshold = 1, inf_alive = TRUE, ext_time = FALSE, print_output = FALSE, ... )library(lefko3) data(cypdata) sizevector <- c(0, 0, 0, 0, 0, 0, 1, 2.5, 4.5, 8, 17.5) stagevector <- c("SD", "P1", "P2", "P3", "SL", "D", "XSm", "Sm", "Md", "Lg", "XLg") repvector <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1) obsvector <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1) matvector <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1) immvector <- c(0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0) propvector <- c(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) indataset <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1) binvec <- c(0, 0, 0, 0, 0, 0.5, 0.5, 1, 1, 2.5, 7) cypframe_raw <- sf_create(sizes = sizevector, stagenames = stagevector, repstatus = repvector, obsstatus = obsvector, matstatus = matvector, propstatus = propvector, immstatus = immvector, indataset = indataset, binhalfwidth = binvec) sizevector <- c(0, 0, 3.0, 15) stagevector <- c("P1", "D", "Sm", "Lg") repvector <- c(0, 0, 1, 1) obsvector <- c(0, 0, 1, 1) matvector <- c(0, 1, 1, 1) immvector <- c(1, 0, 0, 0) indataset <- c(0, 1, 1, 1) binvec <- c(0, 0.5, 2.5, 9.5) cypframe_small_raw <- sf_create(sizes = sizevector, stagenames = stagevector, repstatus = repvector, obsstatus = obsvector, matstatus = matvector, immstatus = immvector, indataset = indataset, binhalfwidth = binvec) cypraw_v1 <- verticalize3(data = cypdata, noyears = 6, firstyear = 2004, patchidcol = "patch", individcol = "plantid", blocksize = 4, sizeacol = "Inf2.04", sizebcol = "Inf.04", sizeccol = "Veg.04", repstracol = "Inf.04", repstrbcol = "Inf2.04", fecacol = "Pod.04", stageassign = cypframe_raw, stagesize = "sizeadded", NAas0 = TRUE, NRasRep = TRUE) cypraw_v2 <- verticalize3(data = cypdata, noyears = 6, firstyear = 2004, patchidcol = "patch", individcol = "plantid", blocksize = 4, sizeacol = "Inf2.04", sizebcol = "Inf.04", sizeccol = "Veg.04", repstracol = "Inf.04", repstrbcol = "Inf2.04", fecacol = "Pod.04", stageassign = cypframe_small_raw, stagesize = "sizeadded", NAas0 = TRUE, NRasRep = TRUE) cypraw_v3 <- verticalize3(data = cypdata, noyears = 6, firstyear = 2004, patchidcol = "patch", individcol = "plantid", blocksize = 4, sizeacol = "Inf2.04", sizebcol = "Inf.04", sizeccol = "Veg.04", repstracol = "Inf.04", repstrbcol = "Inf2.04", fecacol = "Pod.04", NAas0 = TRUE, NRasRep = TRUE) cypsupp2r <- supplemental(stage3 = c("SD", "P1", "P2", "P3", "SL", "D", "XSm", "Sm", "SD", "P1"), stage2 = c("SD", "SD", "P1", "P2", "P3", "SL", "SL", "SL", "rep", "rep"), eststage3 = c(NA, NA, NA, NA, NA, "D", "XSm", "Sm", NA, NA), eststage2 = c(NA, NA, NA, NA, NA, "XSm", "XSm", "XSm", NA, NA), givenrate = c(0.10, 0.20, 0.20, 0.20, 0.25, NA, NA, NA, NA, NA), multiplier = c(NA, NA, NA, NA, NA, NA, NA, NA, 1500, 500), type =c(1, 1, 1, 1, 1, 1, 1, 1, 3, 3), stageframe = cypframe_raw, historical = FALSE) cypmatrix2r <- rlefko2(data = cypraw_v1, stageframe = cypframe_raw, year = "all", patch = "all", stages = c("stage3", "stage2", "stage1"), size = c("size3added", "size2added"), supplement = cypsupp2r, yearcol = "year2", patchcol = "patchid", indivcol = "individ") cypmean <- lmean(cypmatrix2r) cypsupp2r_small <- supplemental(stage3 = c("D", "Sm", "Lg", "P1"), stage2 = c("P1", "P1", "P1", "rep"), eststage3 = c(NA, "Sm", "Lg", NA), eststage2 = c(NA, "D", "D", NA), givenrate = c(0.05, NA, NA, NA), offset = c(NA, NA, -0.1, NA), multiplier = c(NA, NA, NA, 0.5), type =c(1, 1, 1, 3), stageframe = cypframe_small_raw, historical = FALSE) cypmatrix2r_small <- rlefko2(data = cypraw_v2, stageframe = cypframe_small_raw, year = "all", patch = "all", stages = c("stage3", "stage2", "stage1"), size = c("size3added", "size2added"), supplement = cypsupp2r_small, yearcol = "year2", patchcol = "patchid", indivcol = "individ") cypmean_small <- lmean(cypmatrix2r_small) cypmatrixL_small <- rleslie(data = cypraw_v3, start_age = 1, last_age = 4, continue = TRUE, fecage_min = 3, year = "all", pop = NA, patch = "all", yearcol = "year2", patchcol = "patchid", indivcol = "individ") cyp_mpms1 <- list(cypmatrix2r, cypmatrix2r_small, cypmatrixL_small) c2d_4 <- density_input(cypmean, stage3 = c("P1", "P1"), stage2= c("SD", "rep"), style = 1, time_delay = 1, alpha = 1, beta = 0.0005, type = c(2, 2)) c2d_4a <- density_input(cypmean_small, stage3 = c("P1", "P1"), stage2= c("P1", "rep"), style = 1, time_delay = 1, alpha = 1, beta = 0.0005, type = c(2, 2)) cypL_dv <- density_input(cypmatrixL_small, stage3 = c("Age1"), stage2 = c("rep"), style = c(1), alpha = c(0.5), beta = c(1.0), type = c(2)) cyp_density <- list(c2d_4, c2d_4a, cypL_dv) cyp_start1 <- start_input(cypmatrix2r, stage2 = c("SD", "P1", "D"), value = c(100, 200, 4)) cyp_start2 <- start_input(cypmatrix2r_small, stage2 = c("P1", "D"), value = c(10, 2000)) cypL_start_1 <- start_input(cypmatrixL_small, stage2 = c("Age1"), value = c(200)) cyp_start <- list(cyp_start1, cyp_start2, cypL_start_1) new_supplement_cyp2_small <- sup_skeleton(2) new_supplement_cyp2_small$stage3 <- c("D", "Sm") new_supplement_cyp2_small$stage2 <- c("Lg", "Lg") new_supplement_cyp2_small$convtype <- c(1, 1) used_supplements <- list(new_supplement_cyp2_small, new_supplement_cyp2_small, NULL) aaa1_prj_batch2 <- batch_project3(used_mpms = "all", all_elems = FALSE, mpms = cyp_mpms1, entry_time = c(0, 5, 8), times = 15, nreps = 3, supplement = used_supplements, integeronly = TRUE, density = cyp_density) summary(aaa1_prj_batch2)Function ta_skeleton() creates a core data frame that can be modified by users to provide the core variation in transition elements and vital rates to use in invasion analysis. The resulting data frame should be used as input in the axis argument in function invade3().
ta_skeleton(rows = 10L)current_traits <- ta_skeleton(4) current_traits$stage3 <- c("Dorm", "Dorm", "Sdl1", NA) current_traits$stage2 <- c("cut", "V0r", "rep", NA) current_traits$convtype <- c(1, 1, 2, NA) current_traits$offset <- c(0.1, 0.2, 0.3, NA) current_traits$surv_dev <- c(NA, NA, NA, 0.1)Function trait_axis() provides all necessary data for invasion analysis. It lists the specific variations to MPMs for each variant run. Variants can be given via overwritten matrix elements, proxy matrix elements, additive offsets on matrix elements, matrix element multipliers, additive offsets to y-intercepts in vital rate models, or specific values of individual covariates to vary by matrix.
trait_axis( historical = NULL, stagebased = NULL, agebased = NULL, stageframe = NULL, stage3 = NULL, stage2 = NULL, stage1 = NULL, age3 = NULL, age2 = NULL, eststage3 = NULL, eststage2 = NULL, eststage1 = NULL, estage3 = NULL, estage2 = NULL, givenrate = NULL, offset = NULL, multiplier = NULL, type = NULL, type_t12 = NULL, surv_dev = NULL, obs_dev = NULL, size_dev = NULL, sizeb_dev = NULL, sizec_dev = NULL, repst_dev = NULL, fec_dev = NULL, jsurv_dev = NULL, jobs_dev = NULL, jsize_dev = NULL, jsizeb_dev = NULL, jsizec_dev = NULL, jrepst_dev = NULL, jmatst_dev = NULL, indcova = NULL, indcovb = NULL, indcovc = NULL )library(lefko3) data(cypa_data) sizevector <- c(0, 0, 0, 0, 0, 0, 1, 2.5, 4.5, 8, 17.5) stagevector <- c("SD", "P1", "P2", "P3", "SL", "D", "XSm", "Sm", "Md", "Lg", "XLg") repvector <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1) obsvector <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1) matvector <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1) immvector <- c(0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0) propvector <- c(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) indataset <- c(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1) binvec <- c(0, 0, 0, 0, 0, 0.5, 0.5, 1, 1, 2.5, 7) cypframe_raw <- sf_create(sizes = sizevector, stagenames = stagevector, repstatus = repvector, obsstatus = obsvector, matstatus = matvector, propstatus = propvector, immstatus = immvector, indataset = indataset, binhalfwidth = binvec) cypraw_v1 <- verticalize3(data = cypa_data, noyears = 18, firstyear = 1994, individcol = "plant_id", blocksize = 2, sizeacol = "Inf.94", sizebcol = "Veg.94", repstracol = "Inf.94", fecacol = "Inf.94", stageassign = cypframe_raw, stagesize = "sizeadded", NAas0 = TRUE, NRasRep = TRUE) cypa_ta <- trait_axis(stageframe = cypframe_raw, stage3 = c("P1", "P1", "P1", NA, NA, NA), stage2 = c("rep", "rep", "rep", NA, NA, NA), multiplier = c(0.5, 2.0, 10., NA, NA, NA), type = c(2, 2, 2, NA, NA, NA), obs_dev = c(NA, NA, NA, 0.5, 2.0, 50), fec_dev = c(NA, NA, NA, -1000, 0, 1000))| Repository | Version | Published | First seen | Last seen | Docs |
|---|---|---|---|---|---|
| CRAN | 2.0.7 | 2026-05-29 | 2026-05-30 |
표시할 OSV 데이터가 없습니다.
표시할 OpenAlex 데이터가 없습니다.