plot.formula(graphics)
plot.formula()所属R语言包:graphics
Formula Notation for Scatterplots
公式符号为散点图
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Specify a scatterplot or add points, lines, or text via a formula.
指定一个散点图或添加点,线,或通过一个公式中的文本。
用法----------Usage----------
## S3 method for class 'formula'[类formula的方法]
plot(formula, data = parent.frame(), ..., subset,
ylab = varnames[response], ask = dev.interactive())
## S3 method for class 'formula'[类formula的方法]
points(formula, data = parent.frame(), ..., subset)
## S3 method for class 'formula'[类formula的方法]
lines(formula, data = parent.frame(), ..., subset)
## S3 method for class 'formula'[类formula的方法]
text(formula, data = parent.frame(), ..., subset)
参数----------Arguments----------
参数:formula
a formula, such as y ~ x.
formula,如y ~ x的。
参数:data
a data.frame (or list) from which the variables in formula should be taken. A matrix is converted to a data frame.
数据框(或列表)变量formula应采取的。矩阵转换为一个数据框。
参数:...
Arguments to be passed to or from other methods. horizontal = TRUE is also accepted.
参数被传递到或从其他方法。 horizontal = TRUE也是可以接受的。
参数:subset
an optional vector specifying a subset of observations to be used in the fitting process.
一个可选的向量指定要在装修过程中使用的观测的子集。
参数:ylab
the y label of the plot(s).
图的y标签(S)。
参数:ask
logical, see par.
逻辑,看到par。
Details
详情----------Details----------
For the lines, points and text methods the formula should be of the form y ~ x or y ~ 1 with a left-hand side and a single term on the right-hand side. The plot method accepts other forms discussed later in this section.
为lines,points和text方法的公式应该是这样的形式y ~ x或y ~ 1与左边和一个单项右侧。 plot方法接受其他形式在本节后面讨论。
Both the terms in the formula and the ... arguments are evaluated in data enclosed in parent.frame() if data is a list or a data frame. The terms of the formula and those arguments in ... that are of the same length as data are subjected to the subsetting specified in subset. A plot against the running index can be specified as plot(y ~ 1).
公式中的条款和...参数data封闭评估parent.frame()如果data是一个列表或一个数据框。该公式的条款和那些在参数...的data遭受subset指定的子集的长度相同。一对正在运行的指数图,可以指定plot(y ~ 1)。
If the formula in the plot method contains more than one term on the right-hand side, a series of plots is produced of the response against each non-response term.
如果在plot方法的公式包含一个以上的长期右侧,产生了一系列图对每个非响应长期的响应。
For the plot method the formula can be of the form ~ z + y + z: the variables specified on the right-hand side are collected into a data frame, subsetted if specified, and displayed by plot.data.frame.
公式为plot方法的形式可以是~ z + y + z:右侧指定的变量收集到的数据框,如果指定的子集,并显示plot.data.frame。
Missing values are not considered in these methods, and in particular cases with missing values are not removed.
在这些方法中,不考虑遗漏值在遗漏值的特殊情况下不会被删除。
If y is an object (i.e. has a class attribute) then plot.formula looks for a plot method for that class first. Otherwise, the class of x will determine the type of the plot. For factors this will be a parallel boxplot, and argument horizontal = TRUE can be specified (see boxplot).
如果y的是一个对象(即有一个class属性),那么plot.formula为这个类的图方法看起来第一。否则,x类将确定类型的图。为的因素,这将是一个平行的盒形图,并可以指定参数horizontal = TRUE(见boxplot)。
Note that some arguments will need to be protected from premature evaluation by enclosing them in quote: currently this is done automatically for main, sub and xlab. For example, it is needed for the panel.first and panel.last arguments passed to plot.default.
请注意,一些参数将需要保护过早评价,目前,这是自动完成的quote,main和sub括xlab:。例如,它需要为panel.first和panel.last参数传递到plot.default。
值----------Value----------
These functions are invoked for their side effect of drawing on the active graphics device.
调用这些功能都为他们画上活跃的图形设备的副作用。
参见----------See Also----------
plot.default, points, lines, plot.factor.
plot.default,points,lines,plot.factor。
举例----------Examples----------
op <- par(mfrow = c(2,1))
plot(Ozone ~ Wind, data = airquality, pch = as.character(Month))
plot(Ozone ~ Wind, data = airquality, pch = as.character(Month),
subset = Month != 7)
par(op)
## text.formula() can be very natural:[,#text.formula()可以很自然的:]
wb <- within(warpbreaks, {
time <- seq_along(breaks); W.T <- wool:tension })
plot(breaks ~ time, data = wb, type = "b")
text(breaks ~ time, data = wb, label = W.T, col = 1+as.integer(wool))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|