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

R语言:collapse.groupedData()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 18:18:35 | 显示全部楼层 |阅读模式
collapse.groupedData(nlme)
collapse.groupedData()所属R语言包:nlme

                                        Collapse a groupedData Object
                                         折叠groupedData对象

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

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

If object has a single grouping factor, it is returned unchanged. Else, it is summarized by the values of the displayLevel grouping factor (or the combination of its values and the values of the covariate indicated in preserve, if any is present). The collapsed data is used to produce a new groupedData object, with grouping factor given by the displayLevel factor.
如果object有一个单一的分组因素,它原封不动地返回。否则,它总结displayLevel分组因素的值(或它的价值观和协变量的值的组合表示在preserve,如有存在)。倒塌的数据被用来产生一个新的groupedData对象displayLevel因素与分组因素。


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


## S3 method for class 'groupedData'
collapse(object, collapseLevel, displayLevel,
       outer, inner, preserve, FUN, subset, ...)



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

参数:object
an object inheriting from class groupedData, generally with multiple grouping factors.  
一个对象类继承groupedData,一般具有多个分组因素。


参数:collapseLevel
an optional positive integer or character string indicating the grouping level to use when collapsing the data. Level values increase from outermost to innermost grouping. Default is the highest or innermost level of grouping.  
一个可选的正整数或字符串,指示分组级别的数据崩溃时使用。级别值增加从最外层到最内层的分组。默认是分组的最高或最内层的水平。


参数:displayLevel
an optional positive integer or character string indicating the grouping level to use as the grouping factor for the collapsed data. Default is collapseLevel.  
一个可选的正整数或字符串,指示分组级别使用倒塌的数据分组的因素。默认collapseLevel。


参数:outer
an optional logical value or one-sided formula, indicating covariates that are outer to the displayLevel grouping factor. If equal to TRUE, the displayLevel element attr(object, "outer") is used to indicate the  outer covariates. An outer covariate is invariant within the sets of rows defined by the grouping factor.  Ordering of the groups is done in such a way as to preserve adjacency of groups with the same value of the outer variables. Defaults to NULL, meaning that no outer covariates are to be used.   
一个可选的逻辑值或片面的公式,表明displayLevel分组因素是外协变量。如果等于TRUE,displayLevel元素attr(object, "outer")用来指示外协变量。外协变量是不变的定义分组因素的行集内。是在这样一种方式,保持与外部变量的值相同组邻接排列的团体。 NULL默认值,这意味着要使用无外协变量。


参数:inner
an optional logical value or one-sided formula, indicating a covariate that is inner to the displayLevel grouping factor. If equal to TRUE, attr(object, "outer") is used to indicate the inner covariate. An inner covariate can change within the sets of rows defined by the grouping  factor. Defaults to NULL, meaning that no inner covariate is present.     
一个可选的逻辑值或片面的公式,表明displayLevel分组因素是内在的协变量。如果等于TRUE,attr(object, "outer")用来表示内部协变量。一种内在的协变量定义分组因素的行集内可以改变。 NULL默认值,即没有内在的协变量是目前。


参数:preserve
an optional one-sided formula indicating a covariate whose levels should be preserved when collapsing the data according to the collapseLevel grouping factor. The collapsing factor is obtained by pasting together the levels of the collapseLevel grouping factor and the values of the covariate to be preserved. Default is NULL, meaning that no covariates need to be preserved.  
根据collapseLevel分组因素的数据崩溃时,应予以保留一个可选的双面公式表示协变量的水平。崩溃的因素,得到粘贴collapseLevel分组因素和协要保留的值的水平。默认是NULL,这意味着没有需要保留的协变量。


参数:FUN
an optional summary function or a list of summary functions to be used for collapsing the data.  The function or functions are applied only to variables in object that vary within the groups defined by collapseLevel.  Invariant variables are  always summarized by group using the unique value that they assume within that group.  If FUN is a single function it will be applied to each non-invariant variable by group to produce the summary for that variable.  If FUN is a list of functions, the names in the list should designate classes of variables in the data such as ordered, factor, or numeric.  The indicated function will be applied to any non-invariant variables of that class.  The default functions to be used are mean for numeric factors, and Mode for both factor and ordered.  The Mode function, defined internally in gsummary, returns the modal or most popular value of the variable.  It is different from the mode function that returns the S-language mode of the variable.
一个可选的汇总函数或汇总函数的列表将用于折叠的数据。函数或功能只适用于在变量object,在collapseLevel定义组不同。不变的变量总是总结组采用独特的价值,他们在该组承担。 FUN如果是一个单一的功能,将应用于组每个非不变的变量,该变量为生产总结。如果FUN是一个功能列表,列表中的名称应指定变量的类的数据,如ordered,factor或numeric。指定的函数将被应用到这个类的任何非不变的变量。要使用的默认功能是mean数字因素,Mode都factor和ordered。 Mode函数内部定义在gsummary,返回变量的模式或最流行的价值。它mode函数返回变量的S-语言模式是不同的。


参数:subset
an optional named list. Names can be either positive integers representing grouping levels, or names of grouping factors. Each element in the list is a vector indicating the levels of the corresponding grouping factor to be preserved in the collapsed data. Default is NULL, meaning that all levels are used.   
一个可选的命名列表。名称可以是正整数,代表分组级别,或分组因素的名称。列表中的每个元素是一个向量,表示在倒塌的数据保存到相应的分组因素水平。默认是NULL,这意味着各级使用。


参数:...
some methods for this generic require additional arguments.  None are used in this method.  
这个通用的一些方法需要额外的参数。没有使用这种方法。


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

a groupedData object with a single grouping factor given by the displayLevel grouping factor, resulting from collapsing object over the levels of the collapseLevel grouping factor.
groupedData对象displayLevel分组因素的分组与一个单一的因素,导致倒塌objectcollapseLevel分组因素的水平。


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


Jose Pinheiro and Douglas Bates <a href="mailto:bates@stat.wisc.edu">bates@stat.wisc.edu</a>



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

groupedData, plot.nmGroupedData
groupedData,plot.nmGroupedData


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


# collapsing by Dog[倒塌的犬只]
collapse(Pixel, collapse = 1)  # same as collapse(Pixel, collapse = "Dog")[崩溃相同(像素,倒塌=“狗”)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-2-2 22:45 , Processed in 0.019217 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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