summary_hfv {lefko3}R Documentation

Summary of Class "hfvdata"

Description

A function to simplify the viewing of basic information describing demographic data in historical vertical format (data frames of class hfvdata).

Usage

summary_hfv(
  object,
  popid = "popid",
  patchid = "patchid",
  individ = "individ",
  year2id = "year2",
  full = TRUE,
  err_check = TRUE,
  ...
)

Arguments

object

An object of class hfvdata.

popid

A string denoting the name of the variable denoting population identity.

patchid

A string denoting the name of the variable denoting patch identity.

individ

A string denoting the name of the variable denoting individual identity.

year2id

A string denoting the name of the variable denoting the year in time t.

full

A logical value indicating whether to include basic data frame summary information in addition to hfvdata-specific summary information. Defaults to TRUE.

err_check

A logical value indicating whether to check for errors in stage assignment.

...

Other parameters.

Value

A summary of the object. The first line shows the numbers of populations, patches, individuals, and time steps. If full = TRUE, then this is followed by a standard data frame summary of the hfv dataset. If err_check = TRUE, then a subset of the original data frame input as object is exported with only rows showing stage assignment issues.

Notes

Stage assignment issue identified by option err_check fall under two categories. First, all rows showing NoMatch as the identified stage for stage1, stage2, or stage3 are identified. Second, all rows showing stage1 = "NotAlive" and alive1 = 1, stage2 = "NotAlive" and alive2 = 1, or stage3 = "NotAlive" and alive3 = 1 are identified.

Examples

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)

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)

summary_hfv(cypraw_v1)


[Package lefko3 version 6.2.1 Index]