lag.zoo(zoo)
lag.zoo()所属R语言包:zoo
Lags and Differences of zoo Objects
动物园对象的滞后和差异
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Methods for computing lags and differences of "zoo" objects.
方法计算"zoo"对象的滞后和差异。
用法----------Usage----------
## S3 method for class 'zoo'
lag(x, k = 1, na.pad = FALSE, ...)
## S3 method for class 'zoo'
diff(x, lag = 1, differences = 1, arithmetic = TRUE, na.pad = FALSE, ...)
参数----------Arguments----------
参数:x
a "zoo" object.
一个"zoo"对象。
参数:k, lag
For lag the number of lags (in units of observations). Note the sign of k behaves as in lag. For diff it is the number of backward lags used (or if negative the number of forward lags.
对于lag的滞后阶数(单位的观测)。需要注意的符号k的行为作为在lag。对于diff这是一批落后的滞后(或如果为负值,远期滞后。
参数:differences
an integer indicating the order of the difference.
一个整数,指示的顺序的差异。
参数:arithmetic
logical. Should arithmetic (or geometric) differences be computed?
逻辑。如果算术或几何差异计算?
参数:na.pad
logical. If TRUE it adds any times that would not otherwise have been in the result with a value of NA. If FALSE those times are dropped.
逻辑。如果TRUE增加值NA的结果,否则不会有任何时间。如果FALSE时间都将被丢弃。
参数:...
currently not used.
目前未使用。
Details
详细信息----------Details----------
These methods for "zoo" objects behave analogously to the default methods. The only additional arguments are arithmetic in diff na.pad in lag.zoo which can also be specified in diff.zoo as part of the dots. Also, "k" can be a vector of lags in which case the names of "k", if any, are used in naming the result.
这些方法"zoo"对象的行为类似于默认的方法。唯一的额外的参数arithmetic中diffna.padlag.zoo还可以指定在diff.zoo点。另外"k"可以是一个矢量的滞后,在这种情况下的名称"k",如有的话,用于命名的结果。
值----------Value----------
The lagged or differenced "zoo" object.
滞后或差分"zoo"对象。
注意----------Note----------
Note the sign of k: a series lagged by a positive k is shifted earlier in time.
需要注意的符号k:一系列积极的k转移更早的时间滞后。
lag.zoo and lag.zooreg can give different results. For a lag of 1 lag.zoo moves points to the adjacent time point whereas lag.zooreg moves the time by deltat. This implies that a point in a zoo series cannot be lagged to a time point that is not already in the series whereas this is possible for a zooreg series.
lag.zoo和lag.zooreg可以得到不同的结果。对于一个滞后1 lag.zoo的移动到相邻的时间点,而lag.zooreg移动时通过deltat。这意味着,一个zoo系列中的一个点,不能滞后的时间点尚未系列,而这是可能的zooreg系列。
参见----------See Also----------
zoo, lag, diff
zoo,lag,diff
实例----------Examples----------
x <- zoo(11:21)
lag(x, k = 1)
lag(x, k = -1)
# this pairs each value of x with the next or future value[这对每个x的值与下一个或未来值]
merge(x, lag1 = lag(x, k=1))
diff(x^3)
diff(x^3, -1)
diff(x^3, na.pad = TRUE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|