找回密码
 注册
查看: 499|回复: 0

R语言 GeneticsPed包 check()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-25 19:06:23 | 显示全部楼层 |阅读模式
check(GeneticsPed)
check()所属R语言包:GeneticsPed

                                        Check consistency of data in pedigree
                                         检查系谱数据的一致性

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

check performs a series of checks on pedigree object to ensure consistency of data.
check执行一系列上系谱对象的检查,以确保数据的一致性。


用法----------Usage----------


check(x, ...)
checkId(x)



参数----------Arguments----------

参数:x
pedigree, object to be checked
血统,对象进行检查


参数:...
arguments to other methods, none for now
其他方法的参数,现在没有


Details

详情----------Details----------

checkId performs various checks on individuals and their ascendants. These checks are:
checkId执行各种检查,对个人和他们的长辈。这些检查包括:

idClass: all ids must have the same class
idClass:所有ID必须具有相同的类

idIsNA: individual can not be NA
idIsNA:个人不能NA

idNotUnique: individual must be unique
idNotUnique:个人必须是唯一的

idEqualAscendant: individual can not be equal to its ascendant
idEqualAscendant:个人不能等于其方兴未艾

ascendantEqualAscendant: ascendant can not be equal to another ascendant
ascendantEqualAscendant:方兴未艾不能等于另一个方兴未艾

ascendantInAscendant: ascendant can not appear again as asescendant of other sex i.e. father can not be a mother to someone else
不能出现ascendantInAscendant:方兴未艾再次asescendant等性,即父亲不能成为别人的母亲

unusedLevels: in case factors are used for id presentation, there might be unused levels for some ids - some functions rely on number of levels and a check is provided for this
unusedLevels:ID演示因素的情况下,有可能是未使用的一些IDS水平 - 某些功能依赖于多个层面,并提供支票本

checkAttributes is intended primarly for internal use and performs a series of checks on attribute values needed in various functions. It causes stop with error messages for all given attribute checks.
checkAttributes旨在primarly供内部使用和执行一系列检查各种功能所需的属性值。它会导致停止错误消息,所有的属性检查。


值----------Value----------

List of more or less self-explanatory errors and "pointers" to these errors for ease of further work i.e. removing errors.
名单或多或少言自明的错误和这些错误的“指针”,为便于进一步开展工作,即消除错误。


作者(S)----------Author(s)----------


Gregor Gorjanc



参见----------See Also----------

Pedigree
Pedigree


举例----------Examples----------


  ## EXAMPLES BELLOW ARE ONLY FOR TESTING PURPOSES AND ARE NOT INTENDED[#实例波纹管仅用于测试目的,而不是为了]
  ## FOR USERS, BUT IT CAN NOT DO ANY HARM.[#用户,但它不能做任何伤害。]

  ## --- checkAttributes ---[#--- checkAttributes ---]
  tmp <- generatePedigree(5)
  attr(tmp, "sorted") <- FALSE
  attr(tmp, "coded") <- FALSE
  GeneticsPed:::checkAttributes(tmp)
  try(GeneticsPed:::checkAttributes(tmp, sorted=TRUE, coded=TRUE))

  ## --- idClass ---[#--- idClass的---]
  tmp <- generatePedigree(5)
  tmp$id <- factor(tmp$id)
  class(tmp$id)
  class(tmp$father)
  try(GeneticsPed:::idClass(tmp))

  ## --- idIsNA ---[#--- idIsNA ---]
  tmp <- generatePedigree(2)
  tmp[1, 1] <- NA
  GeneticsPed:::idIsNA(tmp)

  ## --- idNotUnique ---[#--- idNotUnique ---]
  tmp <- generatePedigree(2)
  tmp[2, 1] <- 1
  GeneticsPed:::idNotUnique(tmp)

  ## --- idEqualAscendant ---[#--- idEqualAscendant的---]
  tmp <- generatePedigree(2)
  tmp[3, 2] <- tmp[3, 1]
  GeneticsPed:::idEqualAscendant(tmp)

  ## --- ascendantEqualAscendant ---[#--- ascendantEqualAscendant的---]
  tmp <- generatePedigree(2)
  tmp[3, 2] <- tmp[3, 3]
  GeneticsPed:::ascendantEqualAscendant(tmp)

  ## --- ascendantInAscendant ---[#--- ascendantInAscendant的---]
  tmp <- generatePedigree(2)
  tmp[3, 2] <- tmp[5, 3]
  GeneticsPed:::ascendantInAscendant(tmp)
  ## Example with multiple parents[#与多个家长为例]
  tmp <- data.frame(id=c("A", "B", "C", "D"),
                    father1=c("E", NA, "F", "H"),
                    father2=c("F", "E", "E", "I"),
                    mother=c("G", NA, "H", "E"))
  tmp <- Pedigree(tmp, ascendant=c("father1", "father2", "mother"),
                  ascendantSex=c(1, 1, 2),
                  ascendantLevel=c(1, 1, 1))
  GeneticsPed:::ascendantInAscendant(tmp)

  ## --- unusedLevels ---[#--- unusedLevels ---]
  tmp <- generatePedigree(2, colClass="factor")
  tmp[3:4, 2] <- NA
  GeneticsPed:::unusedLevels(tmp)

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-5-23 05:50 , Processed in 0.021272 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表