convert.inp(RMark)
convert.inp()所属R语言包:RMark
Convert MARK input file to RMark dataframe
转换MARK输入文件,RMark的数据框
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Converts encounter history inp files used to create a MARK project into a dataframe for use with RMark. Group structure in frequencies is converted to factor variables that can be used to create groups in RMark. Covariates are copied straight across. Only works with encounter history format for input files and not specialized ones for known-fate or Brownie models.
将遭遇历史INP文件用于创建一个数据框用于与RMark的项目到一个MARK。集团结构转换为频率因子变量可用于创建组在RMark。直接复制整个协变量。只有遭遇历史格式输入文件并没有专门的已知的命运或布朗尼模式。
用法----------Usage----------
convert.inp(inp.filename, group.df = NULL,
covariates = NULL, use.comments = FALSE)
参数----------Arguments----------
参数:inp.filename
name of input file; inp extension is assumed and does not need to be specified
假定输入文件名; INP扩展,并且不需要以指定
参数:group.df
dataframe with grouping variables that contains a row for each group defined in the input file row1=group1, row2=group2 etc. Names and number of columns in the dataframe is set by user to define grouping variables in RMark dataframe
数据框,其中包含一个输入文件中的列1行定义每个组分组变量=组别,ROW2组2等的数据框的列的名称和数量是由用户定义分组变量RMark数据框
参数:covariates
names to be assigned to the covariates defined in the inp file
名被分配到inp文件中定义的协变量
参数:use.comments
if TRUE values within /* and */ on data lines are used as row.names for the RMark dataframe. Only use this option if they are unique values.
如果真正的价值在/ *和* /数据线是用来作为row.names的RMark数据框。使用此选项,如果他们独特的价值观。
Details
详细信息----------Details----------
The encounter history format for MARK is structured as follows: capture (encounter) history, followed by a frequency field for each group, followed by any covariates and then a semi-colon at the end of the line. Comments are allowed within /* and */. The RMark format is a dataframe with a different structure. Each record(row) in the dataframe is for one or more animals within a single group and if there is group structure then the dataframe contains factor variables that can be used to create groups. For example, the following is a little snippet of the same data with 2 groups Males/Females and a covariate weight in the two different formats:
遭遇历史格式MARK结构如下:捕捉(遭遇)的历史,各组的频域,任何协变量,然后一个分号结束的行。评论被允许在/ *和* /。 RMark格式是一种具有不同的结构的数据框。每个记录(行)的数据框是一个组内的一个或更多的动物,如果有组结构的数据框包含因子变量,可以用来创建组。例如,下面是一个小的片段具有2组的男性/女性和协变量重量的两种不同格式中的相同的数据:
值----------Value----------
Dataframe with fields ch(character encounter history), freq (frequency of encounter history), followed by grouping variables (if any) and then covariates (if any)
数据框的字段CH(字符遇到的历史),频率(频率的遭遇历史),其次是分组变量(如果有的话),然后协变量(如果有的话)
(作者)----------Author(s)----------
Jeff Laake
参见----------See Also----------
process.data
process.data
实例----------Examples----------
# MARK example input file[MARK例如输入文件]
pathtodata=paste(path.package("RMark"),"extdata",sep="/")
dipper=convert.inp(paste(pathtodata,"dipper",sep="/"),
group.df=data.frame(sex=c("M","F")))
# Example input files that accompany the MARK electronic book[输入文件的例子,伴随着MARK电子书]
# (http://www.phidot.org/software/mark/docs/book/)[(http://www.phidot.org/software/mark/docs/book/)]
bd=convert.inp(paste(pathtodata,"blckduck",sep="/"),
covariates=c("age","weight","winglen","ci"),use.comments=TRUE)
aa=convert.inp(paste(pathtodata,"aa",sep="/"),
group.df=data.frame(sex=c("Poor","Good")))
adult=convert.inp(paste(pathtodata,"adult",sep="/"))
age=convert.inp(paste(pathtodata,"age",sep="/"))
age_ya=convert.inp(paste(pathtodata,"age_ya",sep="/"),
group.df=data.frame(age=c("Young","Adult")))
capsid=convert.inp(paste(pathtodata,"capsid",sep="/"))
clogit_demo=convert.inp(paste(pathtodata,"clogit_demo",sep="/"))
deer=convert.inp(paste(pathtodata,"deer",sep="/"))
ed_males=convert.inp(paste(pathtodata,"ed_males",sep="/"))
F_age=convert.inp(paste(pathtodata,"F_age",sep="/"))
indcov1=convert.inp(paste(pathtodata,"indcov1",sep="/"),
covariates=c("cov1","cov2"))
indcov2=convert.inp(paste(pathtodata,"indcov2",sep="/"),
covariates=c("cov1","cov2"))
island=convert.inp(paste(pathtodata,"island",sep="/"))
linear=convert.inp(paste(pathtodata,"linear",sep="/"))
young=convert.inp(paste(pathtodata,"young",sep="/"))
transient=convert.inp(paste(pathtodata,"transient",sep="/"))
ms_gof=convert.inp(paste(pathtodata,"ms_gof",sep="/"))
m_age=convert.inp(paste(pathtodata,"m_age",sep="/"))
ms_cjs=convert.inp(paste(pathtodata,"ms_cjs",sep="/"))
ms_directional=convert.inp(paste(pathtodata,"ms_directional",sep="/"))
ed=convert.inp(paste(pathtodata,"ed",sep="/"),
group.df=data.frame(sex=c("Male","Female")))
multigroup=convert.inp(paste(pathtodata,"multi_group",sep="/"),
group.df=data.frame(sex=c(rep("Female",2),rep("Male",2)),
Colony=rep(c("Good","Poor"),2)))
LD1=convert.inp(paste(pathtodata,"LD1",sep="/"),
group.df=data.frame(age=c("Young","Adult")))
yngadt=convert.inp(paste(pathtodata,"yngadt",sep="/"),
group.df=data.frame(age=c("Young","Adult")))
effect_size=convert.inp(paste(pathtodata,"effect_size",sep="/"),
group.df=data.frame(colony=c("Poor","Good")))
effect_size3=convert.inp(paste(pathtodata,"effect_size3",sep="/"),
group.df=data.frame(colony=c("1","2","3")))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|