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

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

[复制链接]
发表于 2012-10-2 07:54:28 | 显示全部楼层 |阅读模式
yearqtr(zoo)
yearqtr()所属R语言包:zoo

                                        An Index Class for Quarterly Data
                                         季度数据的指数类

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

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

"yearqtr" is a class for representing quarterly data.
"yearqtr"是一类为代表的季度数据。


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


yearqtr(x)
as.yearqtr(x, ...)
## S3 method for class 'yearqtr'
format(x, format = "%Y Q%q", ...)



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

参数:x
for yearqtr a numeric (interpreted as being  “in years”).  For as.yearqtr another date class object.  For the "yearqtr" method of format an  object of class "yearqtr" or if called as format.yearqtr then an object with an as.yearqtr method that can be coerced  to "yearqtr".
为yearqtr的数字(解释为“年”)。对于as.yearqtr的另一个日期类对象。对于"yearqtr"方法format类的一个对象"yearqtr"或称为format.yearqtr然后的对象as.yearqtr方法,可以强制转换为 X>。


参数:format
character string specifying format. "%C", "%Y", "%y" and "%q", if present, are replaced with the century, year, last two digits of the year,  and quarter (i.e. a number between 1 and 4), respectively.
字符的字符串,该字符串指定格式。 "%C","%Y","%y"和"%q",如果存在的话,被替换的世纪,年,在今年的最后两位数字,季度(即1之间的一个数和4),分别。


参数:...
other arguments.  Currently not used.
其他参数。目前没有使用。


Details

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

The "yearqtr" class is used to represent quarterly data. Internally it holds the data as year plus 0 for Quarter 1, 1/4 for Quarter 2 and so on in order that its internal representation is the same as  ts class with frequency = 4. If x is not in this format it is rounded via floor(4*x + .0001)/4.
"yearqtr"类是用来表示季度数据。在内部,它保存的数据为年加0,1/4第1季度,第2季度等在其内部表示是一样ts类frequency = 4。如果x是不是这种格式,它是圆形的,通过floor(4*x + .0001)/4。

as.yearqtr.character uses a default format of "%Y Q%q",  "%Y q%q" or "%Y-%q" according to whichever matches. %q accepts the numbers 1-4 (possibly with leading zeros).
as.yearqtr.character使用默认的格式的"%Y Q%q","%Y q%q"或"%Y-%q"根据两者匹配。 %q接受数字1-4(可能带前导零)。

There are coercion methods available for various classes including: default coercion to "yearqtr" (which coerces to "numeric" first) and coercion from "yearqtr" to "Date" (see below), "POSIXct", "POSIXlt", "numeric", "character" and "jul".   The last one is from the frame package on CRAN.
有胁迫的方法,可用于各种类别包括:默认情况下强迫"yearqtr"(胁迫到"numeric")和胁迫从"yearqtr"的"Date"(见下文),"POSIXct","POSIXlt","numeric","character"和"jul"。最后一个是从frame包CRAN。

There is an is.numeric method which returns FALSE.
有一个is.numeric方法返回FALSE。

There is also a date method for as.yearqtr usable with objects created with package date.
还有一个dateas.yearqtr包date创建的对象使用的方法。

Sys.yearqtr() returns the current year/month and methods for min, max and range are defined (by defining  a method for Summary.
Sys.yearqtr()返回当前年/月和方法min,max和range定义(定义的方法Summary。

A yearqtr mean method is also defined.
Ayearqtrmean方法也被定义。

Certain methods support a frac argument.  See yearmon.
某些方法支持frac参数。见yearmon。


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

yearqtr and as.yearqtr return the first argument converted to  class yearqtr. The format method returns a character string representation of its argument first argument.
yearqtr和as.yearqtr返回第一个参数转换为类yearqtr。 format方法返回一个字符串,它的参数的第一个参数表示。


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

yearmon, zoo, zooreg, ts,
yearmon,zoo,zooreg,ts,


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


x <- as.yearqtr(2000 + seq(0, 7)/4)
x

format(x, "%Y Quarter %q")
as.yearqtr("2001 Q2")
as.yearqtr("2001 q2") # same[同]
as.yearqtr("2001-2") # same[同]

# returned Date is the fraction of the way through[返回的日期部分的方式,通过]
# the period given by frac (= 0 by default)[(= 0默认情况下,通过压裂期间)]
dd <- as.Date(x)
format.yearqtr(dd)
as.Date(x, frac = 1)
as.POSIXct(x)

zz <- zoo(rnorm(8), x, frequency = 4)
zz
as.ts(zz)


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-24 01:15 , Processed in 0.032159 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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