xyplot(lattice)
xyplot()所属R语言包:lattice
Common Bivariate Trellis Plots
常见的二元格子图
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This help page documents several commonly used high-level Lattice functions. xyplot produces bivariate scatterplots or time-series plots, bwplot produces box-and-whisker plots, dotplot produces Cleveland dot plots, barchart produces bar plots, and stripplot produces one-dimensional scatterplots. All these functions, along with other high-level Lattice functions, respond to a common set of arguments that control conditioning, layout, aspect ratio, legends, axis annotation, and many other details in a consistent manner. These arguments are described extensively in this help page, and should be used as the reference for other high-level functions as well.
本帮助页的文件几种常用的高层次格功能。 xyplot产生二元散点图或时间序列图,bwplot生产和晶须图,dotplot生产克利夫兰点图,barchart生产条形图,<X >产生一维散点图。所有这些功能,以及与其他高层次格功能,应对一套通用的参数控制空调,布局,长宽比,传说,轴标注,并以一致的方式等诸多细节。这些参数在此帮助页面描述广泛,应使用以及其他高级功能的参考。
For control and customization of the actual display in each panel, the help page of the respective default panel function will often be more informative. In particular, these help pages describe many arguments commonly used when calling the corresponding high-level function but are specific to them.
在每个面板的实际显示控制和定制,在各自的默认面板功能的帮助页面往往会更多的信息。特别是,这些帮助页面描述调用相应的高级功能时,常用的许多论点,但具体到他们。
用法----------Usage----------
xyplot(x, data, ...)
dotplot(x, data, ...)
barchart(x, data, ...)
stripplot(x, data, ...)
bwplot(x, data, ...)
## S3 method for class 'formula'[类formula的方法]
xyplot(x,
data,
allow.multiple = is.null(groups) || outer,
outer = !is.null(groups),
auto.key = FALSE,
aspect = "fill",
panel = lattice.getOption("panel.xyplot"),
prepanel = NULL,
scales = list(),
strip = TRUE,
groups = NULL,
xlab,
xlim,
ylab,
ylim,
drop.unused.levels = lattice.getOption("drop.unused.levels"),
...,
lattice.options = NULL,
default.scales,
default.prepanel = lattice.getOption("prepanel.default.xyplot"),
subscripts = !is.null(groups),
subset = TRUE)
## S3 method for class 'formula'[类formula的方法]
dotplot(x,
data,
panel = lattice.getOption("panel.dotplot"),
default.prepanel = lattice.getOption("prepanel.default.dotplot"),
...)
## S3 method for class 'formula'[类formula的方法]
barchart(x,
data,
panel = lattice.getOption("panel.barchart"),
default.prepanel = lattice.getOption("prepanel.default.barchart"),
box.ratio = 2,
...)
## S3 method for class 'formula'[类formula的方法]
stripplot(x,
data,
panel = lattice.getOption("panel.stripplot"),
default.prepanel = lattice.getOption("prepanel.default.stripplot"),
...)
## S3 method for class 'formula'[类formula的方法]
bwplot(x,
data,
allow.multiple = is.null(groups) || outer,
outer = FALSE,
auto.key = FALSE,
aspect = "fill",
panel = lattice.getOption("panel.bwplot"),
prepanel = NULL,
scales = list(),
strip = TRUE,
groups = NULL,
xlab,
xlim,
ylab,
ylim,
box.ratio = 1,
horizontal = NULL,
drop.unused.levels = lattice.getOption("drop.unused.levels"),
...,
lattice.options = NULL,
default.scales,
default.prepanel = lattice.getOption("prepanel.default.bwplot"),
subscripts = !is.null(groups),
subset = TRUE)
参数----------Arguments----------
参数:x
All high-level function in lattice are generic. x is the object on which method dispatch is carried out. For the "formula" methods, x must be a formula describing the primary variables (used for the per-panel display) and the optional conditioning variables (which define the subsets plotted in different panels) to be used in the plot. Conditioning is described in the “Details” section below. For the functions documented here, the formula is generally of the form y ~ x | g1 * g2 * ... (or equivalently, y ~ x | g1 + g2 + ...), indicating that plots of y (on the y-axis) versus x (on the x-axis) should be produced conditional on the variables g1, g2, .... Here x and y are the primary variables, and g1, g2, ... are the conditioning variables. The conditioning variables may be omitted to give a formula of the form y ~ x, in which case the plot will consist of a single panel with the full dataset. The formula can also involve expressions, e.g., sqrt(), log(), etc. See the data argument below for rules regarding evaluation of the terms in the formula. With the exception of xyplot, the functions documented here may also be supplied a formula of the form ~ x | g1 * g2 * .... In that case, y defaults to names(x) if x is named, and a factor with a single level otherwise. Cases where x is not a formula is handled by appropriate methods. The numeric methods are equivalent to a call with no left hand side and no conditioning variables in the formula. For barchart and dotplot, non-trivial methods exist for tables and arrays, documented at barchart.table. The conditioning variables g1, g2, ... must be either factors or shingles. Shingles provide a way of using numeric variables for conditioning; see the help page of shingle for details. Like factors, they have a "levels" attribute, which is used in producing the conditional plots. If necessary, numeric conditioning variables are converted to shingles using the shingle function; however, using equal.count may be more appropriate in many cases. Character variables are coerced to factors. Extended formula interface: As a useful extension of the interface described above, the primary variable terms (both the LHS y and RHS x) may consist of multiple terms separated by a "+" sign, e.g., y1 + y2 ~ x | a * b. This formula would be taken to mean that the user wants to plot both y1 ~ x | a * b and y2 ~ x | a * b, but with the y1 ~ x and y2 ~ x superposed in each panel. The two groups will be distinguished by different graphical parameters. This is essentially what the groups argument (see below) would produce, if y1 and y2 were concatenated to produce a longer vector, with the groups argument being an indicator of which rows come from which variable. In fact, this is exactly what is done internally using the reshape function. This feature cannot be used in conjunction with the groups argument. To interpret y1 + y2 as a sum, one can either set allow.multiple=FALSE or use I(y1+y2). A variation on this feature is when the outer argument is set to TRUE. In that case, the plots are not superposed in each panel, but instead separated into different panels (as if a new conditioning variable had been added). Primary variables: The x and y variables should both be numeric in xyplot, and an attempt is made to coerce them if not. However, if either is a factor, the levels of that factor are used as axis labels. In the other four functions documented here, exactly one of x and y should be numeric, and the other a factor or shingle. Which of these will happen is determined by the horizontal argument — if horizontal=TRUE, then y will be coerced to be a factor or shingle, otherwise x. The default value of horizontal is FALSE if x is a factor or shingle, TRUE otherwise. (The functionality provided by horizontal=FALSE is not S-compatible.) Note that the x argument used to be called formula in earlier versions (when the high-level functions were not generic and the formula method was essentially the only method). This is no longer allowed. It is recommended that this argument not be named in any case, but instead be the first (unnamed) argument.
lattice的所有高级功能是通用的。 x是方法调度进行了对象。 "formula"方法,x必须是一个公式描述的主要变量(用于每个显示器)和可选的调节变量(定义的子集,在不同的面板绘制)将用于图。空调是在下面的“详细资料”一节所述。这里记录的功能,公式是普遍的形式y ~ x | g1 * g2 * ...(或等价的,y ~ x | g1 + g2 + ...),y(y轴)与x图(x轴)应变量g1, g2, ...生产条件。这里x和y是主要的变量,g1, g2, ...是调节变量。可以省略调理变量给一个公式的形式y ~ x,在这种情况下,该图将组成一个完整的数据集的单面板。公式也涉及表达式,例如,sqrt(),log(),等有关评价公式中的条款规则,下面data参数。 与xyplot例外,这里记录的功能,也可能提供形式 ~ x | g1 * g2 * ...公式。在这种情况下,y默认names(x)如果x命名,否则一个单一层次的因素。的情况下x是不是一个公式是由适当的方法处理。 numeric方法是相当于一个没有左边和公式中没有空调变量调用。 barchart和dotplot,存在非平凡的方法表和数组,记录在barchart.table。调理变量g1, g2, ...必须是因素或带状疱疹。瓦提供了使用空调的数值变量的方式,详见shingle帮助页。因素一样,他们有一个"levels"属性,这是在生产条件的图。如果有必要,数字调节变量转换为使用shingle函数的带状疱疹,但是,使用equal.count可能在许多情况下,更合适。字符变量被强制因素。公式扩展接口:作为一个有用的扩展接口上文所述,两个主要变量条件(在LHSy和RHSx)可能包含一个“+”号分隔的多个条款,例如,y1 + y2 ~ x | a * b。这个公式将采取意味着用户要画出既y1 ~ x | a * b和y2 ~ x | a * b,但y1 ~ x和y2 ~ x在每个小组的叠加。两组将区分不同的图形参数。这实质上是groups参数(见下文),会产生什么,如果y1和y2groups指标参数连接产生一个较长的向量,这行来自哪个变量。事实上,这是做什么reshape函数内部使用。此功能不能与groups参数一起使用。解释y1 + y2作为一个总和,可以设置allow.multiple=FALSE用I(y1+y2)的。此功能的一个变化是设置outer时TRUE参数。在这种情况下,该图并非在每个面板叠加,而是分隔成不同的面板(如,如果一个新的调节变量已被添加)。主要变量:x和y两个变量应该是xyplot数字,并尝试如果不是强迫他们。然而,如果其中一个是一个因素,这个因素的水平轴标签作为。在其他四个功能,记录在这里,完全x和y应该是数字,和其他因素或挂牌之一。这些会发生horizontal参数确定 - 如果horizontal=TRUE然后y将被强制转换为一个因素或挂牌,否则x。默认值horizontal是FALSE如果x是一个因素或挂牌,TRUE否则。 (所提供的功能horizontal=FALSES兼容。)请注意,使用x参数被称为formula在早期版本(当高层次的功能是不通用和公式法基本上是唯一的方法)。这将不再允许。据建议,这种说法不被命名为在任何情况下,反而是第一(无名)参数。
参数:data
For the formula methods, a data frame (or more precisely, anything that is a valid envir argument in eval, e.g., a list or an environment) containing values for any variables in the formula, as well as groups and subset if applicable. If not found in data, or if data is unspecified, the variables are looked for in the environment of the formula. For other methods (where x is not a formula), data is usually ignored, often with a warning if it is explicitly specified.
对于formula方法,一个数据框(或更确切地说,什么是一个有效的envireval,例如,一个列表或环境参数)包含在任何变量的值公式,以及groups和subset如果适用。如果没有找到data或data是不确定的变量查找在公式环境。对于其他的方法(其中x是不是一个公式),data通常被忽略,往往带有警告,如果它明确指定。
参数:allow.multiple
Logical flag specifying whether the extended formula interface described above should be in effect. Defaults to TRUE whenever sensible.
指定是否扩展公式界面上面描述的逻辑标志应该有效。默认TRUE只要合理。
参数:outer
Logical flag controlling what happens with formulas using the extended interface described above (see the entry for x for details). Defaults to FALSE, except when groups is explicitly specified or grouping does not make sense for the default panel function.
逻辑标志控制与使用上面描述的扩展接口的公式发生的事情(见x详情进入)。 FALSE,默认除时groups明确指定或分组不作默认面板功能的意义。
参数:box.ratio
Applicable to barchart and bwplot. Specifies the ratio of the width of the rectangles to the inter-rectangle space. See also the box.width argument in the respective default panel functions.
适用barchart和bwplot。指定的矩形的宽度跨矩形空间的比例。也看到box.width在各自的默认面板功能参数。
参数:horizontal
Logical flag applicable to bwplot, dotplot, barchart, and stripplot. Determines which of x and y is to be a factor or shingle (y if TRUE, x otherwise). Defaults to FALSE if x is a factor or shingle, TRUE otherwise. This argument is used to process the arguments to these high-level functions, but more importantly, it is passed as an argument to the panel function, which is expected to use it as appropriate. A potentially useful component of scales in this case may be abbreviate = TRUE, in which case long labels which would usually overlap will be abbreviated. scales could also contain a minlength argument in this case, which would be passed to the abbreviate function.
逻辑标志适用bwplot,dotplot,barchart和stripplot。确定哪个x和y是一个因素或挂牌(y如果为TRUE,x否则)。默认为FALSE如果x是一个因素或挂牌,TRUE否则。这种说法是用来处理这些高层次的功能参数,但更重要的是,它是通过面板功能,预计使用适当的参数。一个潜在的有用成分scales在这种情况下,可能是abbreviate = TRUE,在这种情况下,通常会重叠的长标签将被缩写。 scales也可以包含一个在这种情况下,minlength参数,这将传递给abbreviate功能。
参数:panel
Once the subset of rows defined by each unique combination of the levels of the grouping variables are obtained (see “Details”), the corresponding x and y variables (or other variables, as appropriate, in the case of other high-level functions) are passed on to be plotted in each panel. The actual plotting is done by the function specified by the panel argument. The argument may be a function object or a character string giving the name of a predefined function. Each high-level function has its own default panel function, named as “panel.” followed by the name of the corresponding high-level function (e.g., panel.xyplot, panel.barchart, etc). Much of the power of Trellis Graphics comes from the ability to define customized panel functions. A panel function appropriate for the functions described here would usually expect arguments named x and y, which would be provided by the conditioning process. It can also have other arguments. It is useful to know in this context that all arguments passed to a high-level Lattice function (such as xyplot) that are not recognized by it are passed through to the panel function. It is thus generally good practice when defining panel functions to allow a ... argument. Such extra arguments typically control graphical parameters, but other uses are also common. See documentation for individual panel functions for specifics. Note that unlike in S-PLUS, it is not guaranteed that panel functions will be supplied only numeric vectors for the x and y arguments; they can be factors as well (but not shingles). Panel functions need to handle this case, which in most cases can be done by simply coercing them to numeric. Technically speaking, panel functions must be written using Grid graphics functions. However, knowledge of Grid is usually not necessary to construct new custom panel functions, as there are several predefined panel functions which can help; for example, panel.grid, panel.loess, etc. There are also some grid-compatible replacements of commonly used traditional graphics functions useful for this purpose. For example, lines can be replaced by llines (or equivalently, panel.lines). Note that traditional graphics functions like lines will not work in a lattice panel function. One case where a bit more is required of the panel function is when the groups argument is not NULL. In that case, the panel function should also accept arguments named groups and subscripts (see below for details). A useful panel function predefined for use in such cases is panel.superpose, which can be combined with different panel.groups functions to determine what is plotted for each group. See the “Examples” section for an interaction plot constructed in this way. Several other panel functions can also handle the groups argument, including the default ones for xyplot, barchart, dotplot, and stripplot. Even when groups is not present, the panel function can have subscripts as a formal argument. In either case, the subscripts argument passed to the panel function are the indices of the x and y data for that panel in the original data, BEFORE taking into account the effect of the subset argument. Note that groups remains unaffected by any subsetting operations, so groups[subscripts] gives the values of groups that correspond to the data in that panel. This interpretation of subscripts does not hold when the extended formula interface is in use (i.e., when allow.multiple is in effect). A comprehensive description would be too complicated (details can be found in the source code of the function latticeParseFormula), but in short, the extended interface works by creating an artificial grouping variable that is longer than the original data frame, and consequently, subscripts needs to refer to rows beyond those in the original data. To further complicate matters, the artificial grouping variable is created after any effect of subset, in which case subscripts may have no relationship with corresponding rows in the original data frame. One can also use functions called panel.number and packet.number, representing panel order and packet order respectively, inside the panel function (as well as the strip function or while interacting with a lattice display using trellis.focus etc). Both provide a simple integer index indicating which panel is currently being drawn, but differ in how the count is calculated. The panel number is a simple incremental counter that starts with 1 and is incremented each time a panel is drawn. The packet number on the other hand indexes the combination of levels of the conditioning variables that is represented by that panel. The two indices coincide unless the order of conditioning variables is permuted and/or the plotting order of levels within one or more conditioning variables is altered (using perm.cond and index.cond respectively), in which case packet.number gives the index corresponding to the "natural" ordering of that combination of levels of the conditioning variables. panel.xyplot has an argument called type which is worth mentioning here because it is quite frequently used (and as mentioned above, can be passed to xyplot directly). In the event that a groups variable is used, panel.xyplot calls panel.superpose, arguments of which can also be passed directly to xyplot. Panel functions for bwplot and friends should have an argument called horizontal to account for the cases when x is the factor or shingle.
一旦得到每个分组变量水平的独特组合定义的行的子集(见“详细资料”),相应x和y变量(或适当的其他变量,其他高级功能的情况下)是通过在每个小组策划。实际绘制完成由panel参数指定的功能。参数可以是一个函数对象或给一个预定义的函数的名称字符串。每一个高层次的功能都有自己的默认面板功能,命名为“panel.”,由相应的高层次功能的名称(例如,panel.xyplot,panel.barchart等)。格子图形的力量大部分来自定义定制的面板功能的能力。一个适当的功能面板功能名为x和y,这将提供调节过程。参数通常会想到这里描述它也可以有其他的参数。它是有用的,知道在这种情况下,所有参数传递到一个高层次的格子功能(xyplot等)传递到面板功能,不经其认可的。因此,它是定义面板功能允许...参数时,一般是很好的做法。这些额外的参数通常控制图形的参数,但其他用途也很常见。看到具体的个别面板功能的文档。请注意,S-PLUS不同,它不能保证将提供面板功能x和y参数的数值向量;他们能因素以及(但不包括带状疱疹)。面板功能需要处理这种情况,这在大多数情况下,可以通过简单地强迫他们为数字。从技术上讲,面板功能,必须书面使用电网的图形功能。然而,知识网格通常是没有必要兴建新的自定义面板功能,因为有几个预定义的面板功能,它可以帮助,例如,panel.grid,panel.loess等有也有一些网格常用的传统的图形功能,为此兼容的替代品。例如,lines可以取代llines(或等价,panel.lines)。请注意,传统的图形功能,如lines格子面板功能将无法正常工作。一个多一点面板功能要求的情况下,当groups参数是不是NULL。在这种情况下,面板的功能也应该接受参数名为groups和subscripts(详见下文)。在这种情况下,使用预定义的一个有用的面板功能是panel.superpose,它可以与不同的panel.groups功能相结合,以确定哪些是绘制各组。请参见“示例”部分以这种方式构建了一个互动图。其他几个面板的功能,还可以处理groups包括xyplot,barchart,dotplot,stripplot默认的参数,。甚至当groups是不存在的,面板功能,可以有subscripts作为一个正式的说法。在任何情况下,subscripts参数传递给面板功能指数x和y原data之前,考虑到的数据,面板影响subset论点。注意groups仍然不受任何子集操作,所以groups[subscripts]给出的值groups对应于该面板中的数据。这subscripts解释扩展公式界面在使用时不持有(即,当allow.multiple效果)。一个全面的描述太复杂(细节可以在函数的源代码发现latticeParseFormula),但在短期,扩展接口的工作创造一个人为的分组变量是长于原始数据框,因此,subscripts需要超越那些在原始数据的行。为了进一步使问题复杂化,人工分组变量创建后的任何效果subset,在这种情况下subscripts可能没有相应的行与原始数据框的关系。也可以使用功能,称为panel.number和packet.number,分别代表面板秩序,包秩序,面板内的功能(以及加沙地带的功能或与点阵显示交互时使用trellis.focus等)。双方表示,目前正在制定的面板提供了一个简单的整数索引,但不同的计数是如何计算的。面板数量是一个简单的增量计数器,从1开始递增每一个小组制定的时间。另一方面索引组合水平的调节变量,由该小组表示的数据包数量。这两个指数相吻合,在这种情况下,除非调节变量的顺序是置换和/或绘制在一个或多个条件变量的水平为了改变(使用perm.cond和index.cond分别)<X >给予相应的指数,以“自然”,调节变量水平的组合订购。 packet.numberpanel.xyplot这里值得一提的是,因为它是相当频繁使用(和上面提到的,可以通过type直接)调用的参数。 xyplot变量使用的事件,groups称panel.xyplot参数,其中也可以直接传递给panel.superpose。 xyplot和朋友的面板功能,应该有一个说法叫bwplot交代的情况下,当horizontal是因子或挂牌。
参数:aspect
This argument controls the physical aspect ratio of the panels, which is usually the same for all the panels. It can be specified as a ratio (vertical size/horizontal size) or as a character string. In the latter case, legitimate values are "fill" (the default) which tries to make the panels as big as possible to fill the available space; "xy", which computes the aspect ratio based on the 45 degree banking rule (see banking); and "iso" for isometric scales, where the relation between physical distance on the device and distance in the data scale are forced to be the same for both axes. If a prepanel function is specified and it returns components dx and dy, these are used for banking calculations. Otherwise, values from the default prepanel function are used. Not all default prepanel functions produce sensible banking calculations.
此参数控制面板,所有的面板通常是相同的物理宽高比。它可以被指定为一比(垂直尺寸/水平大小),或作为一个字符串。在后一种情况下,合法的值是"fill"(默认),试图使尽可能大的面板来填充的可用空间;"xy",45度银行的基础上计算宽高比规则(见banking)"iso"等距尺度,距离在数据规模和设备的物理距离之间的关系,被迫成为两轴相同。如果prepanel函数指定并返回组件dx和dy,这些银行计算。否则,从默认prepanel功能值。所有默认prepanel功能不产生明智的银行计算。
参数:groups
A variable or expression to be evaluated in data, expected to act as a grouping variable within each panel, typically used to distinguish different groups by varying graphical parameters like color and line type. Formally, if groups is specified, then groups along with subscripts is passed to the panel function, which is expected to handle these arguments. For high level functions where grouping is appropriate, the default panel functions can handle grouping. It is very common to use a key (legend) when a grouping variable is specified. See entries for key, auto.key and simpleKey for how to draw a key.
变量或表达式进行评估data,预计将作为内每个小组通常用来区分不同群体,不同的图形参数,如颜色和线型,分组变量。正式地说,如果groups指定,那么groups一起subscripts被传递到面板的功能,预计将处理这些参数。对于高层次的功能是适当的分组,默认的面板功能,可以处理分组。这是很常见到指定分组变量时使用的关键(传说)。看到key,auto.key和simpleKey如何绘制一个关键项。
参数:auto.key
A logical, or a list containing components to be used as arguments to simpleKey. auto.key=TRUE is equivalent to auto.key=list(), in which case simpleKey is called with a set of default arguments (which may depend on the relevant high-level function). Most valid components to the key argument can be specified in this manner, as simpleKey will simply add unrecognized arguments to the list it produces. auto.key is typically used to automatically produce a suitable legend in conjunction with a grouping variable. If auto.key=TRUE, a suitable legend will be drawn if a groups argument is also provided, and not otherwise. In list form, auto.key will modify the default legend thus produced. For example, auto.key=list(columns = 2) will create a legend split into two columns (columns is documented in the entry for key). More precisely, if auto.key is not FALSE, groups is non-null, and there is no key or legend argument specified in the call, a key is created with simpleKey with levels(groups) as the first (text) argument. (Note: this may not work in all high-level functions, but it does work for the ones where grouping makes sense with the default panel function). If auto.key is provided as a list and includes a text component, then that is used instead as the text labels in the key, and the key is drawn even if groups is not specified. Note that simpleKey uses the default settings (see trellis.par.get) to determine the graphical parameters in the key, so the resulting legend will be meaningful only if the same settings are used in the plot as well. The par.settings argument may be useful to temporarily modify the default settings for this purpose. One disadvantage to using key (or even simpleKey) directly is that the graphical parameters used in the key are absolutely determined at the time when the "trellis" object is created. Consequently, if a plot once created is re-plot-ted with different settings, the original parameter settings will be used for the key even though the new settings are used for the actual display. However, with auto.key, the key is actually created at plotting time, so the settings will match.
要使用作为simpleKey参数逻辑,或列表,其中包含的组件。 auto.key=TRUE是auto.key=list(),在这种情况下simpleKey被称为一组默认参数(这可能取决于有关的高层次功能)。在这种方式中,最有效的组件key参数可以指定为simpleKey只会增加无法识别的参数列表,它产生。 auto.key通常用于自动产生合适的传说在结合分组变量。如果auto.key=TRUE的,合适的传说将绘制如果groups参数也提供,而不是别的。以列表的形式,auto.key将修改默认的传说就这样产生了。例如,auto.key=list(columns = 2)将创建传说分裂成两列(columns条目中记载key)。更确切地说,auto.key如果不FALSE,groups非空,有没有key或legend参数调用中指定的一个关键simpleKeylevels(groups)作为第一(text)参数创建。 (注:这可能无法在所有高层次的功能,但它确实工作的分组使得默认面板功能感)。 auto.key如果提供列表,其中包括一个text组件,然后就是用来代替在关键的文字标签,即使groups未指定,关键是制定。注意simpleKey使用默认设置(见trellis.par.get)来确定图形中的关键参数,因此产生的传说将是有意义的只有相同的设置,图以及。 par.settings参数可能是有用的,暂时修改用于此目的的默认设置。一个缺点,使用key(甚至simpleKey)直接的是,在关键的图形参数是绝对时"trellis"对象被创建时确定。因此,如果一旦创建了一个图,是重新plot-TED不同的设置,将原来的参数设置为关键,即使使用新的设置,实际显示使用。然而,与auto.key,实际上是在绘图时创建的关键,因此,设置匹配。
参数:prepanel
A function that takes the same arguments as the panel function and returns a list, possibly containing components named xlim, ylim, dx, and dy (and less frequently, xat and yat). The return value of a user-supplied prepanel function need not contain all these components; in case some are missing, they are replaced by the component-wise defaults. The xlim and ylim components are similar to the high level xlim and ylim arguments (i.e., they are usually a numeric vector of length 2 defining a range, or a character vector representing levels of a factor). If the xlim and ylim arguments are not explicitly specified (possibly as components in scales) in the high-level call, then the actual limits of the panels are guaranteed to include the limits returned by the prepanel function. This happens globally if the relation component of scales is "same", and on a per-panel basis otherwise. The dx and dy components are used for banking computations in case aspect is specified as "xy". See documentation of banking for details. If xlim or ylim is a character vector (which is appropriate when the corresponding variable is a factor), this implicitly indicates that the scale should include the first n integers, where n is the length of xlim or ylim, as the case may be. The elements of the character vector are used as the default labels for these n integers. Thus, to make this information consistent between panels, the xlim or ylim values should represent all the levels of the corresponding factor, even if some are not used within that particular panel. In such cases, an additional component xat or yat may be returned by the prepanel function, which should be a subset of 1:n, indicating which of the n values (levels) are actually represented in the panel. This is useful when calculating the limits with relation="free" or relation="sliced" in scales. The prepanel function is responsible for providing a meaningful return value when the x, y (etc.) variables are zero-length vectors. When nothing else is appropriate, values of NA should be returned for the xlim and ylim components.
作为panel功能相同的参数和函数返回一个列表,可能包含名为xlim,ylim,dx,dy(和组件那么频繁,xat和yat)。一个用户提供prepanel的函数返回值不需要包含所有这些组件的情况下缺少一些,他们更换组件明智的默认。 xlim和ylim组件是类似的高水平xlim和ylim参数(即,它们通常是数值向量的长度为2定义范围,或字符矢量代表水平的一个因素)。如果xlim和ylim参数没有明确指定(可能为scales)在高级别呼叫,然后各小组的实际限制,保证包括限制返回的组件由prepanel功能。发生这种情况,全球范围内,如果组件relationscales"same",每一个面板的基础上,否则。 dx和dy组件银行计算的情况下使用aspect被指定为"xy"。详情请参阅文件banking。如果xlim或ylim是一个字符向量(这是适当的,当相应的变量是一个因素),这含蓄地表示,规模应包括第一n整数,其中<X >是n或xlim,视情况而定的长度。特征向量的元素被用作默认标签这些ylim整数。因此,使这些信息板之间的一致,n或xlim值应该代表了所有相应的因素水平,即使一些不特定面板内使用。在这种情况下,一个额外的组件ylim或xat可返回yat功能,这应该是一个子集prepanel,说明1:n 值(水平)实际上是代表在面板上。计算n或relation="free"relation="sliced"限制时,这是非常有用的。 prepanel功能是负责提供一个有意义的返回值当scales,x(等)的变量是长度为零的向量。当没有其他合适的NA值应返回y和xlim组件。
参数:strip
A logical flag or function. If FALSE, strips are not drawn. Otherwise, strips are drawn using the strip function, which defaults to strip.default. See documentation of strip.default to see the arguments that are available to the strip function. This description also applies to the strip.left argument (see ... below), which can be used to draw strips on the left of each panel (useful for wide short panels, e.g., in time-series plots).
逻辑标志或功能。如果FALSE,带不绘制。否则,带使用strip功能,默认为strip.default绘制。见strip.default条函数的参数是文件。这个描述也适用于strip.left参数(见...以下),可用于绘制条每个面板的左侧(有用的,宽的短板,如时间序列图) 。
参数:xlab
Character or expression (or a "grob") giving label(s) for the x-axis. Generally defaults to the expression for x in the formula defining the plot. Can be specified as NULL to omit the label altogether. Finer control is possible, as described in the entry for main, with the modification that if the label component is omitted from the list, it is replaced by the default xlab.
字符或表达式(或"grob"),标签(S)为X轴。一般默认表达x公式中定义的图。可以被指定为NULL完全省略标签。更精细的控制是可能的,条目中所述的修改,main如果label组件从列表中删除,它是默认的xlab取代。
参数:ylab
Character or expression (or "grob") giving label for the y-axis. Generally defaults to the expression for y in the formula defining the plot. Finer control is possible, see entries for main and xlab.
字符或表达式(或"grob")y轴的标签。一般默认表达y公式中定义的图。更好的控制是可能的,看到main和xlab的条目。
参数:scales
Generally a list determining how the x- and y-axes (tick marks and labels) are drawn. The list contains parameters in name=value form, and may also contain two other lists called x and y of the same form (described below). Components of x and y affect the respective axes only, while those in scales affect both. When parameters are specified in both lists, the values in x or y are used. Note that certain high-level functions have defaults that are specific to a particular axis (e.g., bwplot has alternating=FALSE for the categorical axis only); these can only be overridden by an entry in the corresponding component of scales. As a special exception, scales (or its x and y components) can also be a character string, in which case it is interpreted as the relation component. The possible components are :
一般确定x和y轴(刻度线和标签)如何绘制一个列表。列表中包含name=value形式的参数,可能还包含其他两个名单称为x和y相同的形式(如下所述)。组件x和y只影响各自的轴,而那些在scales都有影响。两份名单中指定参数时,在x或y使用的值。需要注意的是一些高层次的功能具体到一个特定的轴(例如,默认是bwplotalternating=FALSE只为分类轴),这些只能由一个条目在相应的组件覆盖scales。作为一个特殊的例外,scales(或x和y组件)也可以是一个字符串,在这种情况下,它被解释为relation组件。可能的组成部分是:
relation A character string that determines how axis limits are calculated for each panel. Possible values are "same" (default), "free" and "sliced". For relation="same", the same limits, usually large enough to encompass all the data, are used for all the panels. For relation="free", limits for each panel is determined by just the points in that panel. Behavior for relation="sliced" is similar, except that the length (max - min) of the scales are constrained to remain the same across panels. The determination of what axis limits are suitable for each panel can be controlled by the prepanel function, which can be overridden by xlim, ylim or scales$limits (except when relation="sliced", in which case explicitly specified limits are ignored with a warning). When relation is "free", xlim or ylim can be a list, in which case it is treated as if its components were the limit values obtained from the prepanel calculations for each panel (after being replicated if necessary).
relation一个字符串,如何计算轴限制每个小组决定。可能值"same"(默认),"free"和"sliced"。 relation="same",使用相同的限制,通常大到足以涵盖所有的数据,所有的面板。 relation="free",限制每个小组决定在该面板点。 relation="sliced"行为是相似的,除了鳞片的长度(最大值 - 最小值)的限制,以保持相同的跨板。可控制轴限制适用于每个小组的决心prepanel功能,它可以是xlim覆盖,ylim或scales$limits(除非< x>,在这种情况下,明确指定的限制,一个警告被忽略)。当relation="sliced"是relation,"free"或xlim可以是一个列表,在这种情况下,它被视为犹如其组成部分的限制值从每个prepanel计算获得面板(被复制后如有必要)。
tick.number An integer, giving the suggested number of ticks. This is ignored for a factor, shingle or character vector, in which case there is no natural rule for leaving out some of the labels. But see xlim.
tick.number一个整数,刻度线的建议数量。这是被忽略的一个因素,挂牌或特征向量,在这种情况下,没有留出一些标签的自然法则。但看到xlim。
draw A logical flag, defaulting to TRUE, that determines whether to draw the axis at all.
draw逻辑标志,拖欠的TRUE,决定是否提请轴。
alternating Usually a logical flag specifying whether axis labels should alternate from one side of the group of panels to the other. For finer control, alternating can also be a vector (replicated to be as long as the number of rows or columns per page) consisting of the following numbers
alternating一般的逻辑标志指定轴标签是否应该从一个侧面板组的其他候补。为更好的控制,alternating也可以是一个矢量(复制到每页的行或列数)以下数字组成
0: do not draw tick labels
0:不绘制刻度标记
1: bottom/left
1:下/左
2: top/right
2:顶/右
3: both.
3。
alternating applies only when relation="same". The default is TRUE, or equivalently, c(1, 2)
alternating只适用于relation="same"。默认是TRUE,或等价地,c(1, 2)
limits Same as xlim and ylim.
limitsxlim和ylim。
at The location of tick marks along the axis (in native coordinates), or a list as long as the number of panels describing tick locations for each panel.
at沿轴刻度的位置(在本地坐标系),或者,描述刻度线位置,每个小组的板长的列表。
labels Vector of labels (characters or expressions) to go along with at. Can also be a list like at.
labels去at的标签(字符或表达式)的向量。也可以像at名单。
cex A numeric multiplier to control character sizes for axis labels. Can be a vector of length 2, to control left/bottom and right/top labels separately.
cex数值轴标签来控制字符大小的乘数。可以是一个长度为2的向量,分别控制左/底部和右/顶部的标签。
font, fontface, fontfamily Specifies the font to be used for axis labels.
font,fontface,fontfamily指定轴标签使用的字体。
lineheight Specifies the line height parameter (height of line as a multiple of the size of text); relevant for multi-line labels. (This is currently ignored for cloud.)
lineheight指定行的高度参数(线高度作为文字大小的倍数);多行标签有关。 (这是目前被忽略cloud。)
tck Usually a numeric scalar controlling the length of tick marks. Can also be a vector of length 2, to control the length of left/bottom and right/top tick marks separately.
tck一般控制数字标刻度的长度。也可以是一个长度为2的向量,控制分别左/底部和右/顶部刻度的长度。
col Color of tick marks and labels.
col刻度线和标签的颜色。
rot Angle (in degrees) by which the axis labels are to be rotated. Can be a vector of length 2, to control left/bottom and right/top axes separately.
rot角(度)轴标签是要旋转。可以是一个长度为2的向量,分别控制左/底部和右侧/顶轴。
abbreviate A logical flag, indicating whether to abbreviate the labels using the abbreviate function. Can be useful for long labels (e.g., in factors), especially on the x-axis.
abbreviate逻辑标志,指示是否使用abbreviate函数的标签缩写。长标签(例如,在因素),尤其是在x轴,可能是有用的。
minlength Argument passed to abbreviate if abbreviate=TRUE.
minlength论证通过abbreviate如果abbreviate=TRUE。
log Controls whether the corresponding variable (x or y) will be log transformed before being passed to the panel function. Defaults to FALSE, in which case the data are not transformed. Other possible values are any number that works as a base for taking logarithm, TRUE (which is equivalent to 10), and "e" (for the natural logarithm). As a side effect, the corresponding axis is labeled differently. Note that this is in reality a transformation of the data, not the axes. Other than the axis labeling, using this feature is no different than transforming the data in the formula; e.g., scales=list(x = list(log = 2)) is equivalent to y ~ log2(x).
log控制是否将相应的变量(x或y)登录,然后被传递到面板功能转化。默认FALSE,在这种情况下,数据没有改变。其他可能的值是任何工作,作为一个以对数的基础上,TRUE(这相当于10),"e"(自然对数)。作为一个副作用,相应的轴不同的标记。请注意,这是在现实中的数据,而不是轴的改造。比其他的轴标签,使用此功能是转化公式中的数据比没有什么不同;例如,scales=list(x = list(log = 2))是y ~ log2(x)。
format The format to use for POSIXct variables. See strptime for description of valid values.
formatformat使用POSIXct变数。“看到strptime有效值的说明。
axs A character string, "r" (default) or "i". In the latter case, the axis limits are calculated as the exact data range, instead of being padded on either side. (May not always work as expected.) Note that much of the function of scales is accomplished by pscales in splom.
axs字符串,"r"(默认)或"i"。在后者情况下,轴的极限计算的确切数据的范围,而不是任何一方的填充。 (并不总是如预期般运作。)注意多的scales功能pscalessplom完成。
参数:subscripts
A logical flag specifying whether or not a vector named subscripts should be passed to the panel function. Defaults to FALSE, unless groups is specified, or if the panel function accepts an argument named subscripts. This argument is useful if one wants the subscripts to be passed on even if these conditions do not hold; a typical example is when one wishes to augment a Lattice plot after it has been drawn, e.g., using panel.identify.
一个逻辑标志,说明是否或不是一个向量命名为subscripts应传递到面板功能。默认FALSE除非groups指定,或如果面板功能接受一个参数,名为subscripts。这种说法是非常有用的,如果想通过这些条件,即使不持有标以一个典型的例子是当一个人希望扩大后,它已制订的格子图,例如,使用panel.identify。
参数:subset
An expression that evaluates to a logical or integer indexing vector. Like groups, it is evaluated in data. Only the resulting rows of data are used for the plot. If subscripts is TRUE, the subscripts provided to the panel function will be indices referring to the rows of data prior to the subsetting. Whether levels of factors in the data frame that are unused after the subsetting will be dropped depends on the drop.unused.levels argument.
一个表达式,逻辑或整数索引向量。像groups,data评估。只有data行用于图。如果subscripts是TRUE,提供面板功能的标是指data之前的子集的行的索引。无论是在数据框的水平因素后的子集将被丢弃未使用的依赖drop.unused.levels参数。
参数:xlim
Normally a numeric vector (or a DateTime object) of length 2 giving left and right limits for the x-axis, or a character vector, expected to denote the levels of x. The latter form is interpreted as a range containing c(1, length(xlim)), with the character vector determining labels at tick positions 1:length(xlim). xlim could also be a list, with as many components as the number of panels (recycled if necessary), with each component as described above. This is meaningful only when scales$x$relation is "free", in which case these are treated as if they were the corresponding limit components returned by prepanel calculations.
通常是一个数字矢量(或DateTime对象),长度为2提供的X-轴,或一个字符向量预计表示x的水平,左,右的限制。后者的形式被解释为含有C(1,长度(xlim))范围内,与特征向量确定刻度线位置标签1:length(xlim)。 xlim也可以是一个列表,与许多组件面板的数量(如果有必要回收),与以上所述的每个组件。这是有意义的,只有当scales$x$relation"free",在这种情况下,这些被视为他们prepanel计算返回相应的限制组件。
参数:ylim
Similar to xlim, applied to the y-axis.
类似xlim,适用于y轴。
参数:drop.unused.levels
A logical flag indicating whether the unused levels of factors will be dropped, usually relevant with a subsetting operation is performed or an interaction is created. Unused levels are usually dropped, but it is sometimes appropriate to suppress dropping to preserve a useful layout. For finer control, this argument could also be list containing components cond and data, both logical, indicating desired behavior for conditioning variables and primary variables respectively. The default is given by lattice.getOption("drop.unused.levels"), which is initially set to TRUE for both components. Note that this argument does not control dropping of levels of the groups argument.
逻辑的标志,指示是否将未使用的因素水平下降,通常一个子集操作的有关执行或interaction创建。未使用的水平通常会下降,但它有时是适当抑制下降到维持一个有用的布局。更精细的控制,这种说法也可以是列表,其中包含组件cond和data,既符合逻辑,分别指示所需的调节变量和主变量的行为。默认lattice.getOption("drop.unused.levels")TRUE这两个组件,这是初步建立。注意groups参数水平下降,这种说法不控制。
参数:default.scales
A list giving the default values of scales for a particular high-level function. This is rarely of interest to the end-user, but may be helpful when defining other functions that act as a wrapper to one of the high-level Lattice functions.
列表给scales为一个特定的高层次功能的默认值。最终用户的利益,这是很少见,但定义等功能,作为一个高层次的格子功能的包装时,可能会有所帮助。
参数:default.prepanel
A function or character string giving the name of a function that serves as the (component-wise) fallback prepanel function when the prepanel argument is not specified, or does not return all necessary components. The main purpose of this argument is to enable the defaults to be overridden through the use of lattice.options.
给一个函数或字符串函数(组件聪明)的后备prepanel功能的prepanel参数时未指定名称,或不返回所有必要的组件。这一论点的主要目的是为了使默认是通过使用lattice.options覆盖。
参数:lattice.options
A list that could be supplied to lattice.options. These options are applied temporarily for the duration of the call, after which the settings revert back to what they were before. The options are retained along with the object and reused during plotting. This enables the user to attach options settings to the trellis object itself rather than change the settings globally. See also the par.settings argument described below for a similar treatment of graphical settings.
可以提供一个列表,lattice.options。这些选项适用于暂时的通话时间后,设置恢复到他们之前。选项保留沿对象和期间图重用。这使得用户连接选项设置网格对象本身,而不是改变全球设置。还可以看par.settings参数描述为下面的图形设置类似的待遇。
参数:...
Further arguments, usually not directly processed by the high-level functions documented here, but instead passed on to other functions. Such arguments can be broadly categorized into two types: those that affect all high-level Lattice functions in a similar manner, and those that are meant for the specific panel function being used. The first group of arguments are processed by a common, unexported function called trellis.skeleton. These arguments affect all high-level functions, but are only documented here (except to override the behaviour described here). All other arguments specified in a high-level call, specifically those neither described here nor in the help page of the relevant high-level function, are passed unchanged to the panel function used. By convention, the default panel function used for any high-level function is named as “panel.” followed by the name of the high-level function; for example, the default panel function for bwplot is panel.bwplot. In practical terms, this means that in addition to the help page of the high-level function being used, the user should also consult the help page of the corresponding panel function for arguments that may be specified in the high-level call. The effect of the first group of common arguments are as follows:
进一步的论据,通常不直接处理,记录在这里的高层次功能,而是通过其他功能。这样的论点,大致可分为两类:那些以类似的方式影响所有的高级别格子功能,和那些正在使用的特定面板功能意味着。第一组的参数是由一个共同的功能,导出,称为trellis.skeleton处理。这些参数影响所有高层次的功能,但这里只记录(除覆盖这里所描述的行为)。一个高层次的调用中指定的所有其他参数,特别是那些既不描述在这里也不在有关的高层次功能的帮助页面,通过所使用的面板功能不变。按照惯例,任何高层次的功能使用默认面板功能被命名为“panel.”后面的高层次功能的名称;例如,默认的bwplot面板功能是panel.bwplot。在实际应用中,这意味着,除了正在使用的高级功能的帮助页面中,用户还应该咨询相应的面板功能,可在高级别呼叫指定的参数的帮助页面。第一组的共同参数的作用如下:
as.table: A logical flag that controls the order in which panels should be displayed: if FALSE (the default), panels are drawn left to right, bottom to top (as in a graph); if TRUE, left to right, top to bottom (as in a table).
as.table:一个逻辑标志,控制在面板应显示的顺序为:如果FALSE(默认),面板绘制左到右,底部到顶部(如中图); TRUE,左,右,顶部底部(如表)。
between: A list with components x and y (both usually 0 by default), numeric vectors specifying the space between the panels (units are character heights). x and y are repeated to account for all panels in a page and any extra components are ignored. The result is used for all pages in a multi page display. In other words, it is not possible to use different between values for different pages.
between:与组件列表x和y(通常默认0),指定面板之间的空间的数字向量(单位是字符高度)。 x和y重复的帐户页面中的所有面板和任何额外的组件将被忽略。结果被用于在一个多页显示的所有网页。换句话说,它是不可能为不同的页面使用不同的between值。
key: A list that defines a legend to be drawn on the plot. This list is used as an argument to the draw.key function, which produces a "grob" (grid object) eventually plotted by the print method for "trellis" objects. The structure of the legend is constrained in the ways described below. Although such a list can be and often is created explicitly, it is also possible to generate such a list using the simpleKey function; the latter is more convenient but less flexible. The auto.key argument can be even more convenient for the most common situation where legends are used, namely, in conjunction with a grouping variable. To use more than one legend, or to have arbitrary legends not constrained by the structure imposed by key, use the legend argument. The position of the key can be controlled in either of two possible ways. If a component called space is present, the key is positioned outside the plot region, in one of the four sides, determined by the value of space, which can be one of "top", "bottom", "left" and "right". Alternatively, the key can be positioned inside the plot region by specifying components x, y and corner. x and y determine the location of the corner of the key given by corner, which is usually one of c(0,0), c(1,0), c(1,1) and c(0,1), which denote the corners of the unit square. Fractional values are also allowed, in which case x and y determine the position of an arbitrary point inside (or outside for values outside the unit interval) the key. x and y should be numbers between 0 and 1, giving coordinates with respect to the “display area”. Depending on the value of the "legend.bbox" option (see lattice.getOption), this can be either the full figure region ("full"), or just the region that bounds the panels and strips ("panel"). The key essentially consists of a number of columns, possibly divided into blocks, each containing some rows. The contents of the key are determined by (possibly repeated) components named "rectangles", "lines", "points" or "text". Each of these must be lists with relevant graphical parameters (see later) controlling their appearance. The key list itself can contain graphical parameters, these would be used if relevant graphical components are omitted from the other components. The length (number of rows) of each such column (except "text"s) is taken to be the largest of the lengths of the graphical components, including the ones specified outside (see the entry for rep below for details on this). The "text" component must have a character or expression vector as its first component, to be used as labels. The length of this vector determines the number of rows. The graphical components that can be included in key and also in the components named "text", "lines", "points" and "rectangles" (as appropriate) are:
key:一个列表,定义了在图上绘制的传说。这个名单是用来作为一个参数,最终绘制由draw.key对象的打印方法"grob"功能,产生一个"trellis"(网格对象)。传说的结构被限制在下面描述的方法。虽然这样的名单可以往往是明确创建的,它也可能产生这样的列表使用simpleKey函数,后者是更方便,但不够灵活。 auto.key参数,可以更方便的传说,即在结合分组变量,最常见的情况。使用超过一个传说,或有结构约束的任意传说key征收,使用legend参数。关键的位置,可以控制在两种可能的方式之一。如果名为space组件存在,关键是定位图区域外,在四面确定由space的价值,它可以是一个"top" "bottom","left"和"right"。另外,关键图区域内可以定位指定组件x,y和corner。 x和y确定corner,这通常是c(0,0)关键的角落位置,c(1,0),c(1,1), c(0,1),表示单位平方米的角落。分数值也可以,在这种情况下,x和y确定一个任意点内(或外为外单位间隔值)的关键位置。 x和y应该是0和1之间的数字,给人以“展示区”方面的坐标。 "legend.bbox"选项的值而定(见lattice.getOption),这可以是全数字区域("full"),或只是该区域限定板和钢带("panel")。基本上是由数列,可能划分成块,每个都包含一些行的关键。的关键内容是由名为"rectangles","lines","points"或"text"(可能重复)组件。这些都必须与有关图形参数控制其外观(见后面)的名单。 key列表本身可以包含图形的参数,这些将用于相关的图形组件,如果是从其他组件省略。每个这样的列的长度(行数)(除了"text"的)是最大的图形组件的长度,包括指定以外的(见rep下面的条目本)的详细信息。 "text"组成部分,必须有一个作为它的第一部分,将作为标签使用的字符或表达向量。这个向量的长度决定的行数。图形组件,可以在key,并在名为"text","lines","points"和"rectangles"(如适用)的组件包括:
cex=1 (text, lines, points)
cex=1(文字,线条,点)
col="black" (text, rectangles, lines, points)
col="black"(文字,矩形,线,点)
alpha=1 (text, rectangles, lines, points)
alpha=1(文字,矩形,线,点)
fill="transparent" (lines, points)
fill="transparent"(线,点)
lty=1 (lines)
lty=1(系)
lwd=1 (lines, points)
lwd=1(线,点)
font=1 (text, points)
font=1(文字,分)
fontface (text, points)
fontface(文字,分)
fontfamily (text, points)
fontfamily(文字,分)
pch=8 (lines, points)
pch=8(线,点)
adj=0 (text)
adj=0(文本)
type="l" (lines)
type="l"(系)
size=5 (rectangles, lines)
size=5(矩形,线条)
height=1 (rectangles)
height=1(矩形)
lineheight=1 (text)
lineheight=1(文本)
angle=0 (rectangles, but ignored)
angle=0(矩形,但被忽略)
density=-1 (rectangles, but ignored)
density=-1(矩形,但被忽略)
In addition, the component border can be included inside the "rect" component to control the border color of the rectangles; when specified at the top level, border controls the border of the entire key (see below). angle and density are unimplemented. size determines the width of columns of rectangles and lines in character widths. type is relevant for lines; "l" denotes a line, "p" denotes a point, and "b" and "o" both denote both together. height gives heights of rectangles as a fraction of the default. Other possible components of key are:
此外,组件border可以包括里面的"rect"组件来控制矩形边框颜色;在顶层指定时,border控制整个关键的边界(见下文)。 angle和density未实现。 size决定字符宽度的线条和矩形的列的宽度。 type是有关的行;"l"表示一条线,"p"表示一个点,"b"和"o"都表示两者一起。 height给默认的一小部分的矩形的高度。 key其他可能的组成部分:
reverse.rows Logical flag, defaulting to FALSE. If TRUE, all components are reversed after being replicated (the details of which may depend on the value of rep). This is useful in certain situations, e.g., with a grouped barchart with stack = TRUE with the categorical variable on the vertical axis, where the bars in the plot will usually be ordered from bottom to top, but the corresponding legend will have the levels from top to bottom unless reverse.rows = TRUE. Note that in this case, unless all columns have the same number or rows, they will no longer be aligned.
reverse.rows逻辑标志,拖欠FALSE。如果TRUE,所有组件都被复制后逆转(其中的细节可能取决于上rep值)。这是非常有用的,在某些情况下,例如,一个分组barchartstack = TRUE纵轴上,在图的条形通常会从底部到顶部的有序分类变量,但相应的传说将有从上到下的水平,除非reverse.rows = TRUE。请注意,在这种情况下,除非所有列都有相同数量或行,他们将不再对齐。
between Numeric vector giving the amount of space (character widths) surrounding each column (split equally on both sides).
between数字矢量提供的空间量(字符宽度)周围的每一列(分割双方平分)。
title String or expression giving a title for the key.
titleString或表达,给人一种关键的称号。
rep Logical flag, defaults to TRUE. By default, it is assumed that all columns in the key (except the "text"s) will have the same number of rows, and all components are replicated to be as long as the longest. This can be suppressed by specifying rep=FALSE, in which case the length of each column will be determined by components of that column alone.
rep逻辑标志,默认为TRUE。默认情况下,它是假设,在关键的所有列("text"的除外),将有相同的行数,所有组件都复制到最长。这可以通过指定rep=FALSE,在这种情况下,每列的长度将取决于该组件单独列镇压。
cex.title Zoom factor for the title.
cex.title为题的缩放因子。
lines.title The amount of vertical space to be occupied by the title in lines (in multiples of itself). Defaults to 2.
lines.title的垂直空间量线(本身的倍数)的标题被占用。默认为2。
padding.text The amount of space (padding) to be used above and below each row containing text, in multiples of the default, which is currently 0.2 * "lines". This padding is in addition to the normal height of any row that contains text, which is the minimum amount necessary to contain all the text entries.
padding.text的空间量(填充),可以使用默认的倍数,这是目前0.2 * "lines"上面和下面的每一行包含文字。这种填充是除了正常身高的任何行包含文字,这是必要包含所有的文本条目的最低金额。
background Background color for the legend. Defaults to the global background color.
background传说中的背景颜色。默认为全球的背景颜色。
alpha.background An alpha transparency value between 0 and 1 for the background.
alpha.background一个Alpha透明度值介于0和1的背景。
border Either a color for the border, or a logical flag. In the latter case, the border color is black if border is TRUE, and no border is drawn if it is FALSE (the default).
border无论是色彩的边界,或一个逻辑标志。在后一种情况下,边框的颜色是黑色的,如果border是TRUE,无边框绘制,如果它是FALSE(默认)。
transparent=FALSE Logical flag, whether legend should have a transparent background.
transparent=FALSE逻辑的标志,传说是否应该有一个透明的背景。
just A character or numeric vector of length one or two giving horizontal and vertical justification for the placement of the legend. See grid.layout for more precise details.
just字符或数字的长度矢量一个或两个传说中的位置提供水平和垂直的理由。看到grid.layout更精确的细节。
columns The number of column-blocks (drawn side by side) the legend is to be divided into.
columns列块的数量(画并排)传说是要分成。
between.columns Space between column blocks, in addition to between.
between.columns在除了between,列块之间的空间。
divide Number of point symbols to divide each line when type is "b" or "o" in lines.
divide点符号数除以每行的时候type是"b"或"o"lines。
legend: The legend argument can be useful if one wants to place more than one key. It also allows the use of arbitrary "grob"s (grid objects) as legends. If used, legend must be a list, with an arbitrary number of components. Each component must be named one of "left", "right", "top", "bottom", or "inside". The name "inside" can be repeated, but not the others. This name will be used to determine the location for that component, and is similar to the space component of key. If key (or colorkey for levelplot and wireframe) is specified, their space component must not conflict with the name of any component of legend. Each component of legend must have a component called fun. This can be a "grob", or a function (or the name of a function) that produces a "grob" when called. If this function expects any arguments, they must be supplied as a list in another component called args. For components named "inside", there can be additional components called x, y and corner, which work in the same way as for key.
legend:传说参数可以是有用的,如果要放置多个键。它还允许使用任意"grob"(网格对象)作为传说。如果使用legend必须是一个列表,任意数量的一个组成部分。每个组件必须被命名为"left","right","top","bottom"或"inside"。 名"inside"可以重复,但不是别人。此名称将用于确定该组件的位置,并有类似spacekey组件。如果key(或colorkeylevelplot和wireframe)被指定,他们space组件必须不抵触任何组件的名称legend 。 legend的每个组成部分,必须有一个名为fun一个组件。这可以是一个"grob",或一个函数(或函数的名称),产生一个"grob"调用时。如果此功能预计任何参数,他们必须提供在另一个组件称为args列表。名为"inside"组件,可以称为x,y和corner,在同样的方式为key工作的附加组件。
page: A function of one argument (page number) to be called after drawing each page. The function must be "grid-compliant", and is called with the whole display area as the default viewport.
page:绘制每一页后调用函数的一个参数(页码)。该函数必须是“电网兼容,默认视口为整个显示区域调用。
xlab.top, ylab.right: Labels for the x-axis on top, and y-axis on the right. Similar to xlab and ylab, but less commonly used.
xlab.top,ylab.right:x轴顶部的标签,右边的Y轴。类似xlab和ylab,但不太常用。
main: Typically a character string or expression describing the main title to be placed on top of each page. Defaults to NULL. main (as well as xlab, ylab and sub) is usually a character string or an expression that gets used as the label, but can also be a list that controls further details. Expressions are treated as specification of LaTeX-like markup as described in plotmath. The label can be a vector, in which case the components will be spaced out horizontally (or vertically for ylab). This feature can be used to provide column or row labels rather than a single axis label. When main (etc.) is a list, the actual label should be specified as the label component (which may be unnamed if it is the first component). The label can be missing, in which case the default will be used (xlab and ylab usually have defaults, but main and sub do not). Further named arguments are passed on to textGrob; this can include arguments controlling positioning like just and rot as well as graphical parameters such as col and font (see gpar for a full list). main, sub, xlab, ylab, xlab.top, and ylab.right can also be arbitrary "grob"s (grid graphical objects).
main:通常情况下,字符串或表达式描述被放置在每一页的顶部的主标题。 NULL默认。 main(以及xlab,ylab和sub)通常是一个字符串或一个被用来作为标签的表达,但也可以是一个列表控制进一步的细节。表达被视为plotmath的乳液状的标记规范。标签可以是一个向量,在这种情况下,组件将间隔水平(或垂直ylab)。此功能可用于提供,而不是一个单一的轴标签的列或行标签。当main(等)是一个列表,在实际标签应被指定为label组件(这可能是无名的,如果它是第一个组件)。标签可以丢失,在这种情况下,将使用默认值(xlab和ylab通常有默认值,但main和sub不要)。进一步命名参数传递给textGrob;这可以包括参数控制像just和rot以及诸如图形col和font(参数定位看到gpar为一个完整的列表)。 main,sub,xlab,ylab,xlab.top,ylab.right也可以任意"grob"(网格图形对象)。
sub: Character string or expression (or a list or "grob") for a subtitle to be placed at the bottom of each page. See entry for main for finer control options.
sub:字符串或表达式(或列表或"grob")一个被放置在每一页的底部的字幕。见main更好的控制选项的条目。
par.strip.text: A list of parameters to control the appearance of strip text. Notable components are col, cex, font, and lines. The first three control graphical parameters while the last is a means of altering the height of the strips. This can be useful, for example, if the strip labels (derived from factor levels, say) are double height (i.e., contains "\n"-s) or if the default height seems too small or too large. Additionally, the lineheight component can control the space between multiple lines. The labels can be abbreviated when shown by specifying abbreviate = TRUE, in which case the components minlength and dot (passed along to the abbreviate function) can be specified to control the details of how this is done.
par.strip.text:一个参数列表控制带钢文本的外观。值得注意的成分是:col,cex,font,lines。前三控制图形的参数,而最后一个是手段改变带的高度。这可能是有用的,例如,如果带标签(来自因子水平的说)是双高(即包含"\n"-S),或如果默认的高度似乎过小或过大。此外,lineheight组件可以控制多行之间的空间。标签可以缩写指定abbreviate = TRUE,在这种情况下,组件minlength和dot(abbreviate函数传递)可以指定控制的细节如何做到这一点。
layout: In general, a conditioning plot in Lattice consists of several panels arranged in a rectangular array, possibly spanning multiple pages. layout determines this arrangement. layout is a numeric vector of length 2 or 3 giving the number of columns, rows, and pages (optional) in a multipanel display. By default, the number of columns is the number of levels of the first conditioning variable and the number of rows is the number of levels of the second conditioning variable. If there is only one conditioning variable, the default layout vector is c(0,n), where n is the number of levels of the given vector. Any time the first value in the layout vector is 0, the second value is used as the desired number of panels per page and the actual layout is computed from this, taking into account the aspect ratio of the panels and the device dimensions (via par("din")). If NA is specified for the number of rows or columns (but not both), that dimension will be filled out according to the number of panels. The number of pages is by default set to as many as is required to plot all the panels, and so rarely needs to be specified. However, in certain situations the default calculation may be incorrect, and in that case the number of pages needs to be specified explicitly.
layout:一般情况下,在莱迪思空调,图安排在一个长方形阵列,可能跨越多个页面的几个小组组成。 layout确定这样的安排。 layout是一个长度为2或3列,行,在一个多面板显示的页面(可选)数字向量。默认情况下,列数是第一空调变量的水平数和行数是第二个调节变量的水平数。如果只有一个调节变量,默认布局向量是c(0,n),n是给定的向量水平。任何时间在布局向量的第一个值是0,第二个值用于所需为每页小组的数量和布局的实际计算,考虑到板和器件尺寸的长宽比(通过 par("din"))。如果NA指定行或列(但不能同时),将填写该维度根据面板的数量。页数是默认设置如需要绘制所有的面板,所以很少需要指定。然而,在某些情况下,默认的计算可能不正确,并在这种情况下,需要明确指定的页数。
skip: A logical vector (default FALSE), replicated to be as long as the number of panels (spanning all pages). For elements that are TRUE, the corresponding panel position is skipped; i.e., nothing is plotted in that position. The panel that was supposed to be drawn there is now drawn in the next available panel position, and the positions of all the subsequent panels are bumped up accordingly. This may be useful for arranging plots in an informative manner.
skip:一个逻辑向量(默认的FALSE),复制到如面板数量(跨越所有页面)。元素TRUE,相应的面板位置将被跳过,也就是说,没有在该位置绘制。面板应该制定正在制定下一个可用的面板位置,并撞到了相应的所有后续面板的位置。在信息的方式安排的图,这可能是有用的。
strip.left: strip.left can be used to draw strips on the left of each panel, which can be useful for wide short panels, as in time-series (or similar) plots. See the entry for strip for detailed usage.
strip.left:strip.left可以用来绘制每个面板的左侧带,宽短板可以是有用的,因为在时间序列(或类似)图。看到strip详细的使用的条目。
xlab.default, ylab.default: Fallback default for xlab and ylab when they are not specified. If NULL, the defaults are parsed from the Trellis formula. This is rarely useful for the end-user, but can be helpful when developing new Lattice functions.
xlab.default,ylab.default:后备默认xlab和ylab当它们没有被指定。如果NULL,默认解析从格子配方。这是为最终用户很少有用,但可能有助于开发新的莱迪思功能。
xscale.components, yscale.components: Functions that determine axis annotation for the x and y axes respectively. See documentation for xscale.components.default, the default values of these arguments, to learn more.
xscale.components,yscale.components:确定轴的X和Y轴分别标注的函数。 xscale.components.default,这些参数的默认值,以了解更多信息,请参阅文件。
axis: Function responsible for drawing axis annotation. See documentation for axis.default, the default value of this argument, to learn more.
axis:函数负责绘制轴注解。见axis.default的文件,此参数的默认值,以了解更多。
perm.cond: An integer vector, a permutation of 1:n, where n is the number of conditioning variables. By default, the order in which panels are drawn depends on the order of the conditioning variables specified in the formula. perm.cond can modify this order. If the trellis display is thought of as an n-dimensional array, then during printing, its dimensions are permuted using perm.cond as the perm argument does in aperm.
perm.cond:一个整数向量,排列了1:n,其中n是调节变量的数目。默认情况下,在面板的绘制顺序取决于公式中指定的条件变量的顺序。 perm.cond可以修改此订单。如果格子显示被认为n维数组,然后在打印过程中,其尺寸置换使用perm.condperm参数aperm。
index.cond: Whereas perm.cond permutes the dimensions of the multidimensional array of panels, index.cond can be used to subset (or reorder) margins of that array. index.cond can be a list or a function, with behavior in each case described below. The panel display order within each conditioning variable depends on the order of their levels. index.cond can be used to choose a "subset" (in the R sense) of these levels, which is then used as the display order for that variable. If index.cond is a list, it has to be as long as the number of conditioning variables, and the i-th component has to be a valid indexing vector for levels(g_i), where g_i is the i-th conditioning variable in the plot (note that these levels may not contain all levels of the original variable, depending on the effects of the subset and drop.unused.levels arguments). In particular, this indexing may repeat levels, or drop some altogether. The result of this indexing determines the order of panels within that conditioning variable. To keep the order of a particular variable unchanged, the corresponding component must be set to TRUE. Note that the components of index.cond are interpreted in the order of the conditioning variables in the original call, and is not affected by perm.cond. Another possibility is to specify index.cond as a function. In this case, this function is called once for each panel, potentially with all arguments that are passed to the panel function for that panel. (More specifically, if this function has a ... argument, then all panel arguments are passed, otherwise, only named arguments that match are passed.) If there is only one conditioning variable, the levels of that variable are then sorted so that these values are in ascending order. For multiple conditioning variables, the order for each variable is determined by first taking the average over all other conditioning variables. Although they can be supplied in high-level function calls directly, it is more typical to use perm.cond and index.cond to update an existing "trellis" object, thus allowing it to be displayed in a different arrangement without re-calculating the data subsets that go into each panel. In the update.trellis method, both can be set to NULL, which reverts these back to their defaults.
index.cond:鉴于perm.cond置换面板的多维数组的尺寸,index.cond可以使用该数组的子集(或重新排列)利润率。 index.cond可以是一个列表或一个函数,在下面描述每一种情况下的行为。在每个调节变量的面板显示顺序取决于为了自己的水平。 index.cond可以用来选择一个“子集”(R SENSE),这些水平,然后将其作为该变量的显示顺序。如果index.cond是一个列表,它是长期作为调节变量的数目,和i,<levels(g_i)个组件有一个有效的索引向量X>是g_i-TH中的图调节变量(注意,这些水平可能不包含原始变量的所有水平,根据i和subset参数的影响)。这个索引,特别是可重复的水平,或者干脆删除一些。这个索引的结果确定板内,调节变量的顺序。要保持一个特定的变量不变的顺序,必须设置相应的组件drop.unused.levels。请注意,TRUE组件中的调节变量,在原来的呼叫顺序解释,是不是index.cond影响。另一种可能性是指定perm.cond作为一个功能。在这种情况下,这个函数被调用一次,每个小组有可能被传递到该面板的面板功能的所有参数。 (更具体地说,如果这个函数有一个index.cond参数,那么所有的面板参数传递,否则,只能评为那场比赛被传递的参数。)如果只有一个调节变量,该变量的水平,然后排序所以这些值是升序。对于多个条件变量,每个变量的顺序决定首先以平均超过所有其他的调节变量。虽然他们可以提供高级功能,直接调用,这是较为典型的使用...和perm.cond更新现有index.cond对象,从而使其能够在不同的显示无需重新计算的数据子集,每个小组的安排。在"trellis"方法,既可以设置为update.trellis,这回恢复其默认值。
par.settings: A list that could be supplied to trellis.par.set. When the resulting object is plotted, these options are applied temporarily for the duration of the plotting, after which the settings revert back to what they were before. This enables the user to attach some display settings to the trellis object itself rather than change the settings globally. See also the lattice.options argument described above for a similar treatment of non-graphical options.
par.settings:一个可以trellis.par.set提供的名单。绘制时所产生的对象,这些选项适用于暂时绘图,之后的设置恢复到以前他们的时间。这使用户附加一些显示设置网格对象本身,而不是改变全球范围内的设置。还可以看lattice.options参数描述以上的非图形选项类似的待遇。
plot.args: A list containing possible arguments to plot.trellis, which will be used by the plot or print methods when drawing the object, unless overridden explicitly. This enables the user to attach such arguments to the trellis object itself. Partial matching is not performed.
plot.args:一个可能的参数列表,其中包含plot.trellisplot或print方法,将用于绘制对象时,除非重写明确。这使用户能够重视这样的论点,网格对象本身。不执行部分匹配。
Details
详情----------Details----------
The high-level functions documented here, as well as other high-level Lattice functions, are generic, with the formula method usually doing the most substantial work. The structure of the plot that is produced is mostly controlled by the formula (implicitly in the case of the non-formula methods). For each unique combination of the levels of the conditioning variables g1, g2, ..., a separate “packet” is produced, consisting of the points (x,y) for the subset of the data defined by that combination. The display can be thought of as a three-dimensional array of panels, consisting of one two-dimensional matrix per page. The dimensions of this array are determined by the layout argument. If there are no conditioning variables, the plot produced consists of a single packet. Each packet usually corresponds to one panel, but this is not strictly necessary (see the entry for index.cond above).
这里记录的高层次功能,以及其他高层次格的功能,是通用与formula方法通常做的最实质性的工作。产生的图结构,主要是控制由公式(隐含在非公式的方法的情况下)。对于每一个独特的调节变量水平组合g1, g2, ...,一个单独的“包”的制作,包括点(x,y)该组合定义的数据子集。显示器可以被看作是三维阵列的面板组成的一个二维矩阵每页。 layout参数确定这个数组的尺寸。如果没有空调的变量,图由一个单一的数据包。每个包通常对应一个面板,但是这不是绝对必要的(见index.cond以上的条目)。
The coordinate system used by lattice by default is like a graph, with the origin at the bottom left, with axes increasing to the right and top. In particular, panels are by default drawn starting from the bottom left corner, going right and then up, unless as.table = TRUE, in which case panels are drawn from the top left corner, going right and then down. It is possible to set a global preference for the table-like arrangement by changing the default to as.table=TRUE; this can be done by setting lattice.options(default.args = list(as.table = TRUE)). Default values can be set in this manner for the following arguments: as.table, aspect, between, page, main, sub, par.strip.text, layout, skip and strip. Note that these global defaults are sometimes overridden by individual functions.
lattice默认情况下,像一个图,在左下角的起源与轴增加的权利和顶部,使用的坐标系统。尤其是面板默认情况下,绘制从左下角开始,要正确,然后,除非as.table = TRUE,在这种情况下面板是从左上角画,要正确,然后下降。很可能要更改默认设置为表状排列的全球优先as.table=TRUE;这可以通过设置lattice.options(default.args = list(as.table = TRUE))。这种方式,可以设置默认值在以下参数:as.table,aspect,between,page,main,sub, par.strip.text,layout,skip和strip。请注意,这些全球性的默认值有时是由各个功能覆盖。
The order of the panels depends on the order in which the conditioning variables are specified, with g1 varying fastest, followed by g2, and so on. Within a conditioning variable, the order depends on the order of the levels (which for factors is usually in alphabetical order). Both of these orders can be modified using the index.cond and perm.cond arguments, possibly using the update (and other related) method(s).
面板的顺序取决于在其中的调节变量指定的顺序,g1等g2变化最快,其次。在调节变量,顺序取决于上水平(因素是通常按字母顺序排列)的顺序。这些命令都可以使用index.cond和perm.cond参数,可能使用update(及其他相关)方法(S)修改。
值----------Value----------
The high-level functions documented here, as well as other high-level Lattice functions, return an object of class "trellis". The update method can be used to subsequently update components of the object, and the print method (usually called by default) will plot it on an appropriate plotting device.
高级别记录在这里的功能,以及其他高层次格功能,返回一个对象类"trellis"。 update方法可以用于随后更新组件的对象,print方法(通常称为默认)将绘制一个合适的打印设备。
注意----------Note----------
Most of the arguments documented here are also applicable for the other high-level functions in the lattice package. These are not described in any detail elsewhere unless relevant, and this should be considered the canonical documentation for such arguments.
大部分记录在这里的论点也适用lattice包中的其他高层次功能。这些都没有说明任何细节,除非有关的其他地方,这应该被认为是这种论调的规范文件。
Any arguments passed to these functions and not recognized by them will be passed to the panel function. Most predefined panel functions have arguments that customize its output. These arguments are described only in the help pages for these panel functions, but can usually be supplied as arguments to the high-level plot.
通过这些功能,他们不承认任何参数将被传递到面板功能。大多数预定义面板功能定制其输出的参数。只有在这些面板功能的帮助页面描述这些参数,但通常可以提供高级别图的参数。
作者(S)----------Author(s)----------
Deepayan Sarkar <a href="mailtoeepayan.Sarkar@R-project.org">Deepayan.Sarkar@R-project.org</a>
参考文献----------References----------
with R, Springer. http://lmdvr.r-forge.r-project.org/
参见----------See Also----------
Lattice for an overview of the package, as well as barchart.table, print.trellis, shingle, banking, reshape, panel.xyplot, panel.bwplot, panel.barchart, panel.dotplot, panel.stripplot, panel.superpose, panel.loess, panel.average, strip.default, simpleKey trellis.par.set
Lattice包的概述,以及barchart.table,print.trellis,shingle,banking,reshape,panel.xyplot panel.bwplot,panel.barchart,panel.dotplot,panel.stripplot,panel.superpose,panel.loess,panel.average,strip.default, simpleKeytrellis.par.set
举例----------Examples----------
require(stats)
## Tonga Trench Earthquakes[#汤加海沟地震]
Depth <- equal.count(quakes$depth, number=8, overlap=.1)
xyplot(lat ~ long | Depth, data = quakes)
update(trellis.last.object(),
strip = strip.custom(strip.names = TRUE, strip.levels = TRUE),
par.strip.text = list(cex = 0.75),
aspect = "iso")
## Examples with data from `Visualizing Data' (Cleveland, 1993) obtained[#可视化数据“(克利夫兰,1993年)的数据的例子获得]
## from http://cm.bell-labs.com/cm/ms/departments/sia/wsc/[#从http://cm.bell-labs.com/cm/ms/departments/sia/wsc/]
EE <- equal.count(ethanol$E, number=9, overlap=1/4)
## Constructing panel functions on the fly; prepanel[#构建动态面板的功能; prepanel]
xyplot(NOx ~ C | EE, data = ethanol,
prepanel = function(x, y) prepanel.loess(x, y, span = 1),
xlab = "Compression Ratio", ylab = "NOx (micrograms/J)",
panel = function(x, y) {
panel.grid(h = -1, v = 2)
panel.xyplot(x, y)
panel.loess(x, y, span=1)
},
aspect = "xy")
## Extended formula interface [#延期公式接口]
xyplot(Sepal.Length + Sepal.Width ~ Petal.Length + Petal.Width | Species,
data = iris, scales = "free", layout = c(2, 2),
auto.key = list(x = .6, y = .7, corner = c(0, 0)))
## user defined panel functions[#用户自定义面板功能]
states <- data.frame(state.x77,
state.name = dimnames(state.x77)[[1]],
state.region = state.region)
xyplot(Murder ~ Population | state.region, data = states,
groups = state.name,
panel = function(x, y, subscripts, groups) {
ltext(x = x, y = y, labels = groups[subscripts], cex=1,
fontfamily = "HersheySans")
})
## Stacked bar chart[#堆积条形图]
barchart(yield ~ variety | site, data = barley,
groups = year, layout = c(1,6), stack = TRUE,
auto.key = list(space = "right"),
ylab = "Barley Yield (bushels/acre)",
scales = list(x = list(rot = 45)))
bwplot(voice.part ~ height, data=singer, xlab="Height (inches)")
dotplot(variety ~ yield | year * site, data=barley)
## Grouped dot plot showing anomaly at Morris[#分组散点图显示异常莫里斯]
dotplot(variety ~ yield | site, data = barley, groups = year,
key = simpleKey(levels(barley$year), space = "right"),
xlab = "Barley Yield (bushels/acre) ",
aspect=0.5, layout = c(1,6), ylab=NULL)
stripplot(voice.part ~ jitter(height), data = singer, aspect = 1,
jitter.data = TRUE, xlab = "Height (inches)")
## Interaction Plot[#交互作用图]
xyplot(decrease ~ treatment, OrchardSprays, groups = rowpos,
type = "a",
auto.key =
list(space = "right", points = FALSE, lines = TRUE))
## longer version with no x-ticks[#更长的版本没有X-刻度线]
## Not run: [#无法运行:]
bwplot(decrease ~ treatment, OrchardSprays, groups = rowpos,
panel = "panel.superpose",
panel.groups = "panel.linejoin",
xlab = "treatment",
key = list(lines = Rows(trellis.par.get("superpose.line"),
c(1:7, 1)),
text = list(lab = as.character(unique(OrchardSprays$rowpos))),
columns = 4, title = "Row position"))
## End(Not run)[#结束(不运行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|