make.capthist(secr)
make.capthist()所属R语言包:secr
Construct capthist Object
建设capthist对象
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Form a capthist object from a data frame of capture records and a traps object.
从数据框的捕获记录和capthist对象,形成一个traps对象。
用法----------Usage----------
make.capthist(captures, traps, fmt = "trapID", noccasions = NULL,
covnames = NULL, bysession = TRUE, sortrows = TRUE,
cutval = NULL, tol = 0.01, noncapt = "NONE", signalcovariates)
参数----------Arguments----------
参数:captures
dataframe of capture records in one of two possible formats (see Details)
采集记录的数据框的两种格式之一(见详情)
参数:traps
object of class traps describing an array of passive detectors
对象的类traps描述的被动探测器阵列
参数:fmt
character string for capture format. Valid values are "XY" and "trapID".
采集格式的字符串。有效的值是“XY”和“trapID”。
参数:noccasions
number of occasions on which detectors were operated
的场合上,探测器操作
参数:covnames
character vector of names for individual covariate fields
个别协字段的名称的字符向量
参数:bysession
logical, if true then ID are made unique by session
逻辑,如果为true,则ID是唯一的会话
参数:sortrows
logical, if true then rows are sorted in ascending order of animalID
逻辑,如果为true,则行是按升序排列的animalID
参数:cutval
numeric, threshold of signal strength for "signal" detector type
数字的“信号”探测器类型,信号强度阈值
参数:tol
numeric, tolerance in metres when assigning coordinates for "transect" detector type
以米为单位的数值,公差时,将坐标分配划定的探测器类型
参数:noncapt
character value; animal ID used for "no captures"
字符值;用于“没有捕获的动物ID”
参数:signalcovariates
character vector of field names from "captures"
字符向量中的字段名称从“捕获”
Details
详细信息----------Details----------
make.capthist is the most flexible way to prepare data for secr.fit. See read.capthist for a more streamlined way to read data from text files for common detector types. Each row of the input data frame captures represents a detection on one occasion. The capture data frame may be formed from a text file with read.table.
make.capthist是最灵活的方式来准备数据secr.fit。见read.capthist为一个更精简的方式从文本文件中读取数据,常见的探测器类型的。的每行的输入数据框captures代表在一个场合的检测。捕获的数据框可以由一个文本文件,read.table。
Input formats are based on the Density software (Efford 2009; see also ../doc/secr-datainput.pdf). If fmt = "XY" the required fields are (session, ID, occasion, x, y) in that order. If fmt = "trapID" the required fields are (session, ID, occasion, trap), where trap is the numeric index of the relevant detector in traps. session and ID may be character-, vector- or factor-valued; other required fields are numeric. Fields are matched by position (column number), not by name. Columns after the required fields are interpreted as individual covariates that may be continuous (e.g., size) or categorical (e.g., age, sex).
输入格式是基于密度的软件(Efford 2009,又见.. / DOC / SECR的,datainput.pdf)。如果fmt = "XY"所需的字段的顺序是(会议,ID,场合,X,Y)。如果fmt = "trapID"所需的字段(会话ID,场合,陷阱),其中trap是在traps的数字索引的相关检测。 session和ID可能是字符,向量或因子值;其他必要的字段是数值。字段相匹配的位置(列号),叫不上名字。后所需的字段的列被解释为单个协变量可能是连续的(如大小)或类别(如年龄,性别)。
If captures has data from multiple sessions then traps may be either a list of traps objects, one per session, or a single traps object that is assumed to apply throughout. Similarly, noccasions may be a vector specifying the number of occasions in each session.
如果captures具有从多个会话的数据,然后traps可能是traps对象,每一个会话的列表,或一个单一traps的对象,该对象被假定为适用于整个。同样,noccasions可能是一个向量,在每个会话中指定的次数。
Covariates are assumed constant for each individual; the first non-missing value is used. The length of covnames should equal the number of covariate fields in captures.
协变量假定为恒定的,为每个单独的;第一非缺失值被使用的。 covnames的长度应等于在captures协领域的数量。
bysession takes effect when the same individual is detected in two or more sessions: TRUE results in one capture history per session, FALSE has the effect of generating a single capture history (this is not appropriate for the models currently provided in secr).
bysession生效时,同一个人在一个捕捉每个会话的历史中检测到两个或两个以上会议的结果都为TRUE,FALSE的效果产生一个捕捉的历史(这是不适合的机型,目前在 secr“)。
Deaths are coded as negative values in the occasion field of captures. Occasions should be numbered 1, 2, ..., noccasions. By default, the number of occasions is the maximum value of "occasion" in captures.
死亡被编码为负值之际领域的captures。场合,应被编号为1,2,...,noccasions。默认情况下,在一些场合是“场合”在captures的最高值。
Signal strengths may be provided in the fifth (fmt = trapID) or sixth (fmt = XY) columns. Detections with signal strength missing (NA) or below "cutval" are discarded.
的信号强度,也可以设置在第五(FMT = trapID)或第六(FMT = XY)列。侦测与缺少的信号强度(NA)或以下的cutval将被丢弃。
A session may result in no detections. In this case a null line is included in captures using the animal ID field given by noncapt, the maximum occasion number, and any trapID (e.g. "sess1 NONE 5 1" for a 5-occasion session) (or equivalently "sess1 NONE 5 10 10" for fmt = XY).
会话可能会导致没有检测。在这种情况下,一个空行captures使用动物ID字段noncapt,最大场合号,任何trapID的(例如,的“sess1 NONE 5 1”5场合的会话)(或等价的“sess1 NONE 5 10 10”FMT = XY)。
值----------Value----------
An object of class capthist (a matrix or array of detection data with attributes for detector positions etc.). For "single" and "multi" detectors this is a matrix with one row per animal and one column per occasion (dim(capthist)=c(nc,noccasions)); each element is either zero (no detection) or a detector number (the row number in traps not the row name). For "proximity" detectors capthist is an array of values {-1, 0, 1} and dim(capthist)=c(nc,noccasions,ntraps). The number of animals nc is determined from the input, as is noccasions if it is not specified. traps, covariates and other data are retained as attributes of capthist.
类的一个对象capthist(矩阵或阵列检测数据与探测器位置等属性)。对于“单一”和“多”的探测器,这是一个矩阵,每行动物和一列每一次(DIM(capthist)= C(NC,noccasions)的)每个元素都是零(没有检测)或探测器数量(traps不列名中的行号)。 “接近性”探测器capthist是一个数组的值{-1,0,1},DIM(capthist)= C(NC,noccasions,ntraps)的。确定从输入的的动物nc的数量,是noccasions如果它没有被指定。 traps,covariates和其他数据保留作为属性的capthist。
Deaths during the experiment are represented as negative values in capthist.
在实验过程中被表示为负值capthist死亡。
For "signal" and "signalnoise" detectors, the columns of captures identified in signalcovariates are saved along with signal strength measurements in the attribute "signalframe".
“信号”和“signalnoise探测器,列captures,确定在signalcovariates一起保存的信号强度测量属性”signalframe“。
If the input has data from multiple sessions then the output is an object of class c("list","capthist") comprising a list of single-session capthist objects.
如果输入了多个会话的数据,然后输出是一个对象的C类(“名单”,“capthist”),包括单日capthist对象的列表。
注意----------Note----------
make.capthist requires that the data for captures and traps already exist as R objects. To read data from external (text) files, first use read.table and read.traps, or try read.capthist for a one-step solution.
make.capthistcaptures和traps已经存在的R对象的数据。从外部文件(文本)中读取数据,第一次使用read.table和read.traps,或尝试“read.capthist一个一步到位的解决方案。
参考文献----------References----------
capture–recapture. Department of Zoology, University of Otago, Dunedin, New Zealand. http://www.otago.ac.nz/density.
参见----------See Also----------
capthist, traps, read.capthist, secr.fit,
capthist,traps,read.capthist,secr.fit,
实例----------Examples----------
## peek at demonstration data[#偷看演示数据]
head(captXY)
head(trapXY)
demotraps <- read.traps(data = trapXY)
demoCHxy <- make.capthist (captXY, demotraps, fmt = "XY")
demoCHxy ## print method for capthist[打印方法为capthist的]
plot(demoCHxy) ## plot method for capthist[#图为capthist方法]
summary(demoCHxy) ## summary method for capthist[#总结为capthist方法]
## To enter `count' data without manually repeating rows[#进入计数的数据,而无需手动重复的行]
## need a frequency vector f, length(f) == nrow(captXY)[#需要的频率向量f,长度(F)== NROW(captXY)]
n <- nrow(captXY)
f <- sample (1:5, size = n, prob = rep(0.2,5), replace = TRUE)
## repeat rows as required...[#重复行的要求...]
captXY <- captXY[rep(1:n, f),]
counttraps <- read.traps(data = trapXY, detector = "count")
countCH <- make.capthist (captXY, counttraps, fmt = "XY")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|