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

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

[复制链接]
发表于 2012-2-16 21:27:36 | 显示全部楼层 |阅读模式
coplot(graphics)
coplot()所属R语言包:graphics

                                        Conditioning Plots
                                         空调图解

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

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

This function produces two variants of the conditioning plots discussed in the reference below.
此功能参考下面讨论的空调图产生两个变种。


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


coplot(formula, data, given.values, panel = points, rows, columns,
       show.given = TRUE, col = par("fg"), pch = par("pch"),
       bar.bg = c(num = gray(0.8), fac = gray(0.95)),
       xlab = c(x.name, paste("Given :", a.name)),
       ylab = c(y.name, paste("Given :", b.name)),
       subscripts = FALSE,
       axlabels = function(f) abbreviate(levels(f)),
       number = 6, overlap = 0.5, xlim, ylim, ...)
co.intervals(x, number = 6, overlap = 0.5)



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

参数:formula
a formula describing the form of conditioning plot.  A formula of the form y ~ x | a indicates that plots of y versus x should be produced conditional on the variable a.  A formula of the form y ~ x| a * b indicates that plots of y versus x should be produced conditional on the two variables a and b.  All three or four variables may be either numeric or factors. When x or y are factors, the result is almost as if as.numeric() was applied, whereas for factor a or b, the conditioning (and its graphics if show.given is true) are adapted.  
公式空调图的形式。公式的形式y ~ x | a表明图y与x应生产条件变量a。公式的形式y ~ x| a * b表明图y与x须出示的两个变量a和b条件。所有三个或四个变量可以是数字或因素。当x或y的因素,结果几乎是一样如果as.numeric()应用,而为的因素a或b,空调(和它的图形适应show.given如果是真的)。


参数:data
a data frame containing values for any variables in the formula.  By default the environment where coplot was called from is used.
一个数据框包含公式中的任何变量的值。默认情况下,其中coplot被称为环境。


参数:given.values
a value or list of two values which determine how the conditioning on a and b is to take place.  When there is no b (i.e., conditioning only on a), usually this is a matrix with two columns each row of which gives an interval, to be conditioned on, but is can also be a single vector of numbers or a set of factor levels (if the variable being conditioned on is a factor). In this case (no b), the result of co.intervals can be used directly as given.values argument.  
一个值或两个值确定名单a和b是要发生的空调。当有没有b,通常这是一个两列矩阵的每一行给出了一个区间,条件,但也可以是一个单一的(即,只对a空调)向量的数字或一组因子水平(如果条件变量是一个因素)。在这种情况下(没有b),co.intervalsgiven.values参数可用作直接的结果。


参数:panel
a function(x, y, col, pch, ...) which gives the action to be carried out in each panel of the display.  The default is points.
function(x, y, col, pch, ...)这使在每个显示面板进行操作。默认points。


参数:rows
the panels of the plot are laid out in a rows by columns array.  rows gives the number of rows in the array.
图板被放置在一个由rows阵列columns。 rows给数组中的行的数量。


参数:columns
the number of columns in the panel layout array.
在面板布局阵列的列数。


参数:show.given
logical (possibly of length 2 for 2 conditioning variables): should conditioning plots be shown for the corresponding conditioning variables (default TRUE).
逻辑(可能是2调节变量的长度2):空调图应进行相应的调节变量显示(默认的TRUE)。


参数:col
a vector of colors to be used to plot the points.  If too short, the values are recycled.
要使用的颜色向量绘制点。如果太短,回收价值。


参数:pch
a vector of plotting symbols or characters.  If too short, the values are recycled.
矢量绘制符号或字符。如果太短,回收价值。


参数:bar.bg
a named vector with components "num" and "fac" giving the background colors for the (shingle) bars, for numeric and factor conditioning variables respectively.
一个组件的命名向量"num"和"fac"给(瓦)条形的背景颜色,分别为数字和因素调节变量。


参数:xlab
character; labels to use for the x axis and the first conditioning variable.  If only one label is given, it is used for the x axis and the default label is used for the conditioning variable.
字符;标签使用的X轴和第一调节变量。如果只有一个标签,它是用于X轴和调节变量的默认标签。


参数:ylab
character; labels to use for the y axis and any second conditioning variable.
字符;标签使用的Y轴和任何第二个调节变量。


参数:subscripts
logical: if true the panel function is given an additional (third) argument subscripts giving the subscripts of the data passed to that panel.
逻辑:如果属实面板功能给出一个额外的(三)subscripts提供的数据传递给该面板标参数。


参数:axlabels
function for creating axis (tick) labels when x or y are factors.
函数用于创建轴(打勾)标签,当X或Y的因素。


参数:number
integer; the number of conditioning intervals, for a and b, possibly of length 2.  It is only used if the corresponding conditioning variable is not a factor.
整数;空调的时间间隔的数量,可能长度为2,A和B。它仅用于相应的调节变量是不是一个factor。


参数:overlap
numeric < 1; the fraction of overlap of the conditioning variables, possibly of length 2 for x and y direction.  When overlap < 0, there will be gaps between the data slices.
数字<1;可能的X和Y方向长度为2,调节变量的重叠部分。 <0时,重叠,会有资料片之间的差距。


参数:xlim
the range for the x axis.
为x轴的范围。


参数:ylim
the range for the y axis.
y轴的范围。


参数:...
additional arguments to the panel function.
面板功能的附加参数。


参数:x
a numeric vector.
数字向量。


Details

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

In the case of a single conditioning variable a, when both rows and columns are unspecified, a "close to square" layout is chosen with columns >= rows.
在一个单一的调节变量a,当两个rows和columns是不确定的,“接近正方形的布局与columns >= rows选择。

In the case of multiple rows, the order of the panel plots is from the bottom and from the left (corresponding to increasing a, typically).
在多个rows,面板图的顺序是从底部,从左边(对应增加a,通常)。

A panel function should not attempt to start a new plot, but just plot within a given coordinate system: thus plot and boxplot are not panel functions.
一个面板功能不应该尝试启动一个新的图,但只是在给定的坐标系中的图:plot和boxplot是不是面板功能。

The rendering of arguments xlab and ylab is not controlled by par arguments cex.lab and font.lab even though they are plotted by mtext rather than title.
渲染参数xlab和ylab不控制par参数cex.lab和font.lab即使他们绘制mtext而不是 title。


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

co.intervals(., number, .) returns a (number x 2) matrix, say ci,  where ci[k,] is the range of x values for the k-th interval.
co.intervals(., number, .)返回(numberx2)matrix的说cici[k,]是range<X >x次间隔值。


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

Data for models. Chapter 3 of Statistical Models in S eds J. M. Chambers and T. J. Hastie, Wadsworth &amp; Brooks/Cole.


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

pairs, panel.smooth, points.
pairs,panel.smooth,points。


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


## Tonga Trench Earthquakes[#汤加海沟地震]
coplot(lat ~ long | depth, data = quakes)
given.depth <- co.intervals(quakes$depth, number=4, overlap=.1)
coplot(lat ~ long | depth, data = quakes, given.v=given.depth, rows=1)

## Conditioning on 2 variables:[#空调2个变量:]
ll.dm <- lat ~ long | depth * mag
coplot(ll.dm, data = quakes)
coplot(ll.dm, data = quakes, number=c(4,7), show.given=c(TRUE,FALSE))
coplot(ll.dm, data = quakes, number=c(3,7),
       overlap=c(-.5,.1)) # negative overlap DROPS values[负重叠DROPS值]

## given two factors[#给定的两个因素]
Index &lt;- seq(length=nrow(warpbreaks)) # to get nicer default labels[获得更好的默认标签]
coplot(breaks ~ Index | wool * tension, data = warpbreaks,
       show.given = 0:1)
coplot(breaks ~ Index | wool * tension, data = warpbreaks,
       col = "red", bg = "pink", pch = 21,
       bar.bg = c(fac = "light blue"))

## Example with empty panels:[#空面板为例:]
with(data.frame(state.x77), {
coplot(Life.Exp ~ Income | Illiteracy * state.region, number = 3,
       panel = function(x, y, ...) panel.smooth(x, y, span = .8, ...))
## y ~ factor -- not really sensible, but 'show off':[#Y因子 - 不是真的很明智的,但“炫耀”:]
coplot(Life.Exp ~ state.region | Income * state.division,
       panel = panel.smooth)
})

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-23 22:30 , Processed in 0.025931 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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