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

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

[复制链接]
发表于 2012-2-16 17:31:15 | 显示全部楼层 |阅读模式
xyplot.ts(lattice)
xyplot.ts()所属R语言包:lattice

                                        Time series plotting methods
                                         时间序列的绘制方法

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

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

This function handles time series plotting, including cut-and-stack plots. Examples are given of superposing, juxtaposing and styling different time series.
这个函数处理时间序列绘制,包括削减和协议栈的图。例子给出的叠加,并列和造型不同的时间序列。


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


## S3 method for class 'ts'
xyplot(x, data = NULL,
       screens = if (superpose) 1 else colnames(x),
       ...,
       superpose = FALSE,
       cut = FALSE,
       type = "l",
       col = NULL,
       lty = NULL,
       lwd = NULL,
       pch = NULL,
       cex = NULL,
       fill = NULL,
       auto.key = superpose,
       panel = if (superpose) "panel.superpose"
               else "panel.superpose.plain",
       par.settings = list(),
       layout = NULL, as.table = TRUE,
       xlab = "Time", ylab = NULL,
       default.scales = list(y = list(relation =
           if (missing(cut)) "free" else "same")))



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

参数:x
an object of class ts, which may be multi-variate, i.e. have a matrix structure with multiple columns.  
类对象ts,这可能是多变量,即有多个列的矩阵结构。


参数:data
not used, and must be left as NULL.  
不使用,必须为NULL离开。


参数:...
additional arguments passed to xyplot, which may pass them on to panel.xyplot.  
额外的参数传递xyplot,这可能将它们传递到panel.xyplot。


参数:screens
factor (or coerced to factor) whose levels specify which panel each series is to be plotted in.  screens = c(1, 2, 1) would plot series 1, 2 and 3 in panels 1, 2 and 1. May also be a named list, see Details below.  
因子(或强迫因子)指定每个系列的面板是要绘制英寸screens = c(1, 2, 1)将绘制在1,2和1板系列的第1,第2和第3的水平。也可能是一个名为列表,详见下文。


参数:superpose
overlays all series in one panel (via screens = 1) and uses grouped style settings (from trellis.par.get("superpose.line"), etc). Note that this is just a convenience argument: its only action is to change the default values of other arguments.  
覆盖所有系列在一个面板(通过screens = 1),并使用分组的样式设置(从trellis.par.get("superpose.line")等)。请注意,这仅仅是一个方便的参数:其唯一的行动是改变其他参数的默认值。


参数:cut
defines a cut-and-stack plot. cut can be a list of arguments to the function equal.count, i.e. number (number of intervals to divide into) and overlap (the fraction of overlap between cuts, default 0.5). If cut is numeric this is passed as the number argument.  cut = TRUE tries to choose an appropriate number of cuts (up to a maximum of 6), using banking, and assuming a square plot region. This should have the effect of minimising wasted space when aspect = "xy".  
定义一个剪切和栈的图。 cut是list参数equal.count,即number(区间分成)和overlap(重叠的部分之间的功能削减,默认为0.5)。如果cut的是数字,这是通过作为number参数。 cut = TRUE尝试选择适当数量削减(最多6),使用banking,并假设一个正方形的图区域。这应该有效果时最大限度地减少浪费的空间aspect = "xy"。


参数:type, col, lty, lwd, pch, cex, fill
graphical arguments, which are processed and eventually passed to panel.xyplot. These arguments can also be vectors or (named) lists, see Details for more information.  
图形参数,处理,并最终通过了panel.xyplot。这些参数也可以是向量或(命名)名单,看到更多的信息的详细信息。


参数:auto.key
a logical, or a list describing how to draw a key. See the auto.key entry in xyplot. The default here is to draw lines, not points, and any specified style arguments should show up automatically.  
逻辑,或列表描述了如何利用一个关键。 auto.keyxyplot。这里默认的是画线,而不是点,任何指定的风格参数自动显示出来。


参数:panel
the panel function. It is recommended to leave this alone, but one can pass a panel.groups argument which is handled by panel.superpose for each series.   
面板功能。建议离开就凭这一点,但可以通过panel.groupspanel.superpose每个系列处理的参数。


参数:par.settings
style settings beyond the standard col, lty, lwd, etc; see trellis.par.set and simpleTheme.  
样式设置超出标准的col,lty,lwd等trellis.par.set和simpleTheme。


参数:layout
numeric vector of length 2 specifying number of columns and rows in the plot. The default is to fill columns with up to 6 rows.  
长度为2的数字矢量指定数列和行中的图。默认是填补了6行列。


参数:as.table
to draw panels from top to bottom. The order is determined by the order of columns in x.  
绘制面板从上到下。顺序是确定由x的列的顺序。


参数:xlab, ylab
X axis and Y axis labels; see xyplot. Note in particular that ylab may be a character vector, in which case the labels are spaced out equally, to correspond to the panels; but NOTE in this case the vector should be reversed OR the argument as.table set to FALSE.   
X轴和Y轴的标签;xyplot。特别要注意ylab可能是一个特征向量,在这种情况下,标签间距平均,对应面板,但要注意在这种情况下,向量应该得到扭转或参数as.table设置FALSE。


参数:default.scales
scales specification. The default is set to have "free" Y axis scales unless cut is given. Note, users should pass the scales argument rather than default.scales.  
scales规范。除非"free"给出默认设置有cutY轴尺度。请注意,用户应通过scales参数,而不是default.scales。


Details

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

The handling of several graphical parameters is more flexible for multivariate series. These parameters can be vectors of the same length as the number of series plotted or are recycled if shorter. They can also be (partially) named list, e.g., list(A = c(1,2), c(3,4)) in which c(3, 4) is the default value and c(1, 2) the value only for series A. The screens argument can be specified in a similar way.
几个图形参数的处理是更灵活的多元系列。这些参数可以是相同长度的向量作为绘制的序列号或回收,如果短。它们也可以是命名名单(部分),例如,list(A = c(1,2), c(3,4))中c(3, 4)是默认值,只为系列c(1, 2)A的价值。 screens参数,可以指定以类似的方式。

Some examples are given below.
下面给出了一些例子。


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

An object of class "trellis". The update method can be used to update components of the object and the print method (usually called by default) will plot it on an appropriate plotting device.
对象类"trellis"。 update方法可以用来更新的对象和print方法(通常称为默认情况下),将适当的绘图设备上绘制它的组成部分。


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



Gabor Grothendieck, Achim Zeileis, Deepayan Sarkar and Felix Andrews
<a href="mailto:felix@nfrac.org">felix@nfrac.org</a>.

The first two authors developed <code>xyplot.ts</code> in their <span class="pkg">zoo</span>
package, including the <code>screens</code> approach. The third author
developed a different <code>xyplot.ts</code> for cut-and-stack plots in the
<span class="pkg">latticeExtra</span> package. The final author fused these together.




参考文献----------References----------

Visualization with R, Springer. http://lmdvr.r-forge.r-project.org/ (cut-and-stack plots)

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

xyplot, panel.xyplot, plot.ts, ts, xyplot.zoo in the zoo package.
xyplot,panel.xyplot,plot.ts,ts,xyplot.zoozoo包。


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


xyplot(ts(c(1:10,10:1)))

### Figure 14.1 from Sarkar (2008)[##图14.1萨卡(2008)]
xyplot(sunspot.year, aspect = "xy",
       strip = FALSE, strip.left = TRUE,
       cut = list(number = 4, overlap = 0.05))

### A multivariate example; first juxtaposed, then superposed[#一个多元的例子,第一并列,然后叠加]
xyplot(EuStockMarkets, scales = list(y = "same"))
xyplot(EuStockMarkets, superpose = TRUE, aspect = "xy", lwd = 2,
    type = c("l","g"), ylim = c(0, max(EuStockMarkets)))

### Examples using screens (these two are identical)[#使用屏幕(这两个是相同的例子)]
xyplot(EuStockMarkets, screens = c(rep("Continental", 3), "UK"))
xyplot(EuStockMarkets, screens = list(FTSE = "UK", "Continental"))

### Automatic group styles[#自动组风格]
xyplot(EuStockMarkets, screens = list(FTSE = "UK", "Continental"),
    superpose = TRUE)

xyplot(EuStockMarkets, screens = list(FTSE = "UK", "Continental"),
    superpose = TRUE, xlim = extendrange(1996:1998),
    par.settings = standard.theme(color = FALSE))

### Specifying styles for series by name[#指定款式系列的名字]
xyplot(EuStockMarkets, screens = list(FTSE = "UK", "Continental"),
    col = list(DAX = "red", FTSE = "blue", "black"), auto.key = TRUE)

xyplot(EuStockMarkets, screens = list(FTSE = "UK", "Continental"),
    col = list(DAX = "red"), lty = list(SMI = 2), lwd = 1:2,
    auto.key = TRUE)

### Example with simpler data, few data points[#为例,用简单的数据,一些数据点]
set.seed(1)
z <- ts(cbind(a = 1:5, b = 11:15, c = 21:25) + rnorm(5))
xyplot(z, screens = 1)
xyplot(z, screens = list(a = "primary (a)", "other (b &amp; c)"),
  type = list(a = c("p", "h"), b = c("p", "s"), "o"),
  pch = list(a = 2, c = 3), auto.key = list(type = "o"))

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-23 00:53 , Processed in 0.023522 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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