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

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

[复制链接]
发表于 2012-10-1 15:45:01 | 显示全部楼层 |阅读模式
moffset(VGAM)
moffset()所属R语言包:VGAM

                                         Matrix Offset
                                         矩阵偏移

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

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

Modify a matrix by shifting successive elements.
修改矩阵不断变化的连续元素。


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


moffset(mat, roffset = 0, coffset = 0, postfix = "")




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

参数:mat
Data frame or matrix. This ought to have at least three rows and three columns. The elements are shifted in the order of c(mat), i.e., going down successive columns, as the columns go from left to right. Wrapping of values is done.  
数据框或矩阵。这应该具有至少三行和三列。元素被移位下去c(mat),即,连续列的顺序,作为列去由左到右。包装的价值就完成了。


参数:roffset, coffset
Numeric or character. If numeric, the amount of shift (offset) for each row and column. The default is no change to mat. If character, the offset is computed by matching with the row or column names. For example, for the alcoff, put roffset = "6" means that we make an effective day's dataset start from 6:00 am, and this wraps around to  include midnight to 05.59 am on the next day.  
数字或字符。如果数字,每行和每列的移位(偏移)的量。默认情况下是没有改变mat。如果字符偏移量的计算方法是匹配的行或列名。例如,对于alcoff,把roffset = "6"是指我们作出的生效日期的数据集从早上6:00开始,绕到包括午夜至第二天上午5点59分。


参数:postfix
Character. Modified rows and columns are renamed by pasting this argument to the end of each name. The default is no change.  
字符。修改的行和列被重命名,这种说法粘贴到结束的每一个名字。默认情况下是没有任何变化。


Details

详细信息----------Details----------

This function allows a matrix to be rearranged so that element (roffset + 1, coffset + 1) becomes the (1, 1) element. The elements are assumed to be ordered in the same way as the elements of c(mat),
此功能允许一个矩阵来重新排列,使元件(roffset+ 1,coffset+ 1),成为(1,1)的元件。的元素作为元素c(mat)被假定为以相同的方式排列的,

This function is applicable to, e.g., alcoff, where it is useful to define the effective day as starting at some other hour than midnight, e.g., 6.00am. This is because partying on Friday night continues on into Saturday morning, therefore it is more interpretable to use the effective day when considering a daily effect.
此功能适用,例如,alcoff,它是有用的,在其他一些小时,比午夜,例如,早上6点开始,定义生效之日。这是因为上周五晚上聚会持续到周六上午,因此它使用的生效日期时,考虑每天的效果是更多的解释。

This is a data preprocessing function for rcam and plotrcam0.  The differences between Rcam and moffset is that Rcam only reorders the level of the rows and columns so that the data is shifted but not moved. That is, a value in one row stays in that row, and ditto for column.  But in moffset values in one column can be moved to a previous column. See the examples below.
这是一个数据预处理功能为rcam和plotrcam0。之间的差异Rcam和moffset是Rcam只重新排列的行和列的水平,以使数据被移动,但不移动。即,在一行中的值保持在该行中,同上,用于列。但在moffset在一列中的值可以被移动到先前的专栏文章。请参见下面的例子。


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

A matrix of the same dimensional as its input.
作为它的输入相同的维的矩阵。


注意----------Note----------

The input mat should have row names and column names.
输入mat应该有行名和列名。


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



T. W. Yee,
Alfian F. Hadi.




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

Rcam,  rcam,  plotrcam0, alcoff, crashi.
Rcam,rcam,plotrcam0,alcoff,crashi。


实例----------Examples----------


moffset(alcoff, 3, 2, "*")  # Some day's data is moved to previous day.[移动到前一天有一天的数据。]
Rcam(alcoff, 3 + 1, 2 + 1)  # Data does not move as much.[数据不一样多。]
alcoff  # Original data[原始数据]
moffset(alcoff, 3, 2, "*") - Rcam(alcoff, 3+1, 2+1) # Note the differences[需要注意的差异]

# An 'effective day' data set:[“有效一天的数据集:]
alcoff.e <- moffset(alcoff, roffset = "6", postfix = "*")
fit.o &lt;- rcam(alcoff)    # default baselines are first row and col[默认情况下,基线是第一行和COL]
fit.e &lt;- rcam(alcoff.e)  # default baselines are first row and col [默认情况下,基线是第一行和COL]

## Not run:  par(mfrow = c(2, 2), mar = c(9,4,2,1))[#不运行:PAR(mfrow = C(2,2),月= C(9,4,2,1))]
plot(fit.o, rsub = "Not very interpretable", csub = "Not very interpretable")
plot(fit.e, rsub = "More interpretable", csub = "More interpretable")

## End(Not run)[#(不执行)]

# Some checking[一些检查]
all.equal(moffset(alcoff), alcoff)      # Should be no change[应该没有变化]
moffset(alcoff, 1, 1, "*")
moffset(alcoff, 2, 3, "*")
moffset(alcoff, 1, 0, "*")
moffset(alcoff, 0, 1, "*")
moffset(alcoff, "6", "Monday", "*")  # This one is good[这是不错]

# Customise row and column baselines[自定义行和列的基准]
fit2 <- rcam(Rcam(alcoff.e, rbaseline = "11", cbaseline = "Monday*"))

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-26 14:48 , Processed in 0.028542 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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