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

R语言 rpart.plot包 prp()函数中文帮助文档(中英文对照)

  [复制链接]
发表于 2012-9-27 23:45:28 | 显示全部楼层 |阅读模式
prp(rpart.plot)
prp()所属R语言包:rpart.plot

                                        Plot an rpart model.  A superset of rpart.plot.
                                         绘制的软件rpart的模型。一个超集rpart.plot。

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

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

Plot an rpart model. The arguments of this function are a superset of those of rpart.plot. See ../doc/prp.pdf for an overview.     
画出一个rpart模型。这个函数的参数的rpart.plot的一个超集。查看/ DOC / prp.pdf的一个综述。


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


prp(x=stop("no 'x' arg"),
    type=0, extra=0, under=FALSE, clip.right.labs=TRUE,
    nn=FALSE, ni=FALSE, yesno=TRUE,
    fallen.leaves=FALSE, branch=if(fallen.leaves) 1 else .2,
    uniform=TRUE, left=TRUE, xflip=FALSE, yflip=FALSE,
    Margin=0, space=1, gap=NULL,
    digits=2, varlen=-8, faclen=3,
    cex=NULL, tweak=1,
    compress=TRUE, ycompress=uniform,
    trace=FALSE, snip=FALSE, snip.fun=NULL,

    box.col=0, border.col=col,
    round=NULL, leaf.round=NULL,
    shadow.col=0, prefix="", suffix="", xsep=NULL,

    under.font=font, under.col=1, under.cex=.8,

    split.cex=1, split.font=2, split.family=family, split.col=1,
    split.box.col=0, split.border.col=0,
    split.lty=1, split.lwd=NULL, split.round=0,
    split.shadow.col=0,
    split.prefix="", right.split.prefix=NULL,
    split.suffix="", right.split.suffix=NULL,
    facsep=",", eq=" = ", lt=" < ", ge=" >= ",

    branch.col=if(identical(branch.type, 0)) 1 else "gray",
    branch.lty=1, branch.lwd=NULL,
    branch.type=0, branch.tweak=1,
    min.branch.width=.002, branch.fill=branch.col,

    nn.cex=NULL, nn.font=3, nn.family="", nn.col=1,
    nn.box.col=0, nn.border.col=nn.col,
    nn.lty=1, nn.lwd=NULL, nn.round=.3,

    node.fun=internal.node.labs,
    split.fun=internal.split.labs,
    FUN=text,

    nspace=branch, minbranch=.3, do.par=TRUE,
    add.labs=TRUE, clip.left.labs=FALSE, fam.main="",
    yshift=0, yspace=space, shadow.offset=.4,
    split.adj=NULL, split.yshift=0, split.space=space,
    split.yspace=yspace, split.shadow.offset=shadow.offset,
    nn.adj=.5, nn.yshift=0, nn.space=.8, nn.yspace=.5,
    ygap=gap/2, under.ygap=.5, yesno.yshift=0,
    xcompact=TRUE, ycompact=uniform, xcompact.ratio=.8, min.inter.height=4,
    max.auto.cex=1, min.auto.cex=.15, ycompress.cex=.7, accept.cex=1.1,
    shift.amounts=c(1.5, 2),
    Fallen.yspace=.1, boxes.include.gap=FALSE,
    ...)



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

参数:x
An rpart object.  The only required argument.  
rpart对象。唯一需要的参数。


参数:type
Type of plot. Five possibilities:  0 The default.  Draw a split label at each split and a node label at each leaf.  1 Label all nodes, not just leaves. Similar to text.rpart's all=TRUE.  2 Like 1 but draw the split labels below the node labels. Similar to the plots in the CART book.  3 Draw separate split labels for the left and right directions.  4 Like 3 but label all nodes, not just leaves. Similar to text.rpart's fancy=TRUE. See also clip.right.labs.<br>  
图类型。五可能性:0默认值。绘制分割标签,在每个分割和每一片叶子节点标签。 1标签的所有节点,不只是离开了。类似“text.rpart的all=TRUE。 2像1“但画分割标签的节点下方的标签。类似的图在购物车中的书。 3绘制单独分割为左,右方向的标签。 4喜欢3“但标签的所有节点,不只是离开了。类似“text.rpart的fancy=TRUE。请参阅clip.right.labs。<BR>


参数:extra
Display extra information at the nodes. Possible values:  0 No extra information (the default).  1 Display the number of observations that fall in the node (per class for class objects; prefixed by the number of events for poisson and exp models). Similar to text.rpart's use.n=TRUE.  2 Class models: display the classification rate at the node, expressed as the number of correct classifications and the number of observations in the node.<br> Poisson and exp models: display the number of events.  3 Class models: misclassification rate at the node, expressed as the number of incorrect classifications and the number of observations in the node.  4 Class models: probability per class of observations in the node (conditioned on the node, sum across a node is 1).       5 Class models: like 4 but do not display the fitted class.  6 Class models: the probability of the second class only. Useful for binary responses.  7 Class models: like 6 but do not display the fitted class.  8 Class models: the probability of the fitted class.  9 Class models: the probabilities times the fraction of observations in the node (the probability relative to all observations, sum across all leaves is 1).  +100 Add 100 to any of the above to also display the percentage of observations in the node. For example extra=101 displays the number and percentage of observations in the node. Actually, it's a weighted percentage using the weights passed to rpart.<br>  Note 1: Unlike text.rpart, by default prp uses its own routine for generating node  labels (not the function attached to the object). See node.fun.<br> Note 2: mrt models (the mvpart package) are also supported. See get.mrt.labs in the source code.  
显示节点的额外信息。可能的值:0没有额外的信息(默认值)。 1显示数量的观察,在节点(每类class对象前缀poisson和exp模型)的事件数的。类似“text.rpart的use.n=TRUE。 2类模型:在节点中显示的分类率,表示正确的分类和若干意见的节点的数量。参考泊松和EXP模型的:显示事件的数量。 3类模型:在该节点上的误判率,表示为不正确的分类和观测值的数量在节点的数目。 4级车型:每类观测节点(节点上的空调,在一个节点的总和为1)的概率。 5级车型:,像4但不显示安装类。 6级车型:第二类的概率。有用的二进制反应。 7级车型:,像6但不显示安装类。 8级车型的拟合类的概率。 9级车型:的概率倍的部分观测节点(相对于所有观测值的概率,在所有叶子的总和为1)。 +100添加100任何上述也显示节点中的观测值的百分比。例如extra=101显示观测节点的数量和比例。其实,这是一个加权百分比的weights传递给rpart。<BR>注1:不同text.rpart,默认情况下,prp使用其自己的程序生成节点标签(不附加到对象上的功能)。 node.fun。<BR>注2:mrt模型(mvpart包)也支持。 get.mrt.labs的源代码。


参数:under
Applies only if extra > 0. Default FALSE, meaning put the extra text in the box. Use TRUE to put the text under the box. See also under.cex.  
适用只有extra > 0。默认FALSE,意思是把多余的文本框中输入。使用TRUE把下面的文本框。 under.cex。


参数:clip.right.labs
Default is TRUE meaning &ldquo;clip&rdquo; the right split labels, i.e. do not print variable=. Applies only if type=3 or 4. See also clip.left.labs.  
默认是TRUE,意思是“剪辑”右分割标签,即不打印variable=。适用于只有type=3或4。 clip.left.labs。


参数:nn
Display the node numbers. Default FALSE. (In the current implementation some overplotting may occur with nn=TRUE.)  
显示节点号。默认FALSE。 (在目前的实现一些overplotting可能发生的nn=TRUE。)


参数:ni
Display the node indices, i.e. the row numbers of the nodes in the object's frame. Default FALSE.  
显示节点的指数,即节点的行号,在该对象的frame。默认FALSE。


参数:yesno
Default TRUE, meaning write yes and no on the appropriate sides of the top split. Ignored if type=3 or 4. (Use nn.col and the other nn parameters to change the color etc. of the yesno text.)  
默认TRUE,意思是写yes和no在适当的两侧上方的分割。如果type=3或4忽略。 (使用nn.col和其他nn参数来改变yesno文本的颜色等。)


参数:fallen.leaves
Default FALSE. If TRUE, display the leaves at the bottom of the graph.  
默认FALSE。如果TRUE,显示在图形底部的叶子。


参数:branch
Controls the shape of the branch lines. Specify a value between 0 (V shaped branches) and 1 (square shouldered branches). Default is if(fallen.leaves) 1 else .2.  
控制的分支线的形状。 0(V形分支之间指定一个值)和1(方肩分行)。默认是if(fallen.leaves) 1 else .2。


参数:uniform
If TRUE (the default), the vertical spacing of the nodes is uniform. If FALSE, the nodes are spaced proportionally to the fit (more precisely, to the difference between a node's deviance and the sum of its two children's deviances). Small vertical spaces are automatically artificially expanded to make room for the labels, see minbranch. Note: uniform=FALSE with cex=NULL (the default) can sometimes cause very small text.  
如果TRUE(默认值),节点的垂直间距是一致的。如果FALSE,节点隔开比例的拟合(更精确地,一个节点之间的差异的偏差和的总和,它的两个孩子的deviances)。小垂直空格将自动被人为地扩大,以腾出空间的标签,看到minbranch。注:uniform=FALSE与cex=NULL(默认值),有时会导致非常小的文本。


参数:left
Default TRUE, meaning the left side of a split is the path taken if the split condition is true. With left=FALSE the split labels are changed so the right side is true.  
默认的TRUE,这意味着分裂的左侧是所采取的路径,如果分割的条件是真。 left=FALSE分割标签被改变,,所以右侧是真实的。


参数:xflip
Default FALSE. If TRUE, flip the tree horizontally.  
默认FALSE。如果TRUE,翻转树的水平。


参数:yflip
Default FALSE. If TRUE, flip the tree vertically, so the root is at the bottom.  
默认FALSE。如果TRUE,翻转垂直树,所以根是在底部。


参数:Margin
Extra white space around the tree, as a fraction of the graph width. Default 0, meaning no extra space. To add say 10% space around the tree use Margin=0.1. (This is the margin argument of plot.rpart. The name was changed to prevent partial matching with mar, which can be passed in as a ... argument.)  
多余的空白空间的图形宽度的一小部分,因为周围的树。默认0,这意味着没有多余的空间。要添加的说,10%的空间,周围的树上使用Margin=0.1。 (这是margin的plot.rpart参数。更名为防止部分匹配mar,这可以通过在...参数)。


参数:gap
Minimum horizontal gap between the (possibly invisible) boxes, in character widths. Default NULL, meaning automatically choose a suitable value (normally 1, but if the graph is very crowded will be set to 0, permitting boxes to touch to allow a bigger cex). See also space.  
(可能是不可见的)盒,在字符宽度的最低水平之间的差距。默认NULL,这意味着自动选择一个合适的值(通常是“1,但如果该图是非常拥挤将被设置为0,允许盒子触摸允许更大的cex的)。 space。


参数:digits
The number of significant digits in displayed numbers. Default 2. If 0, use getOption("digits"). Details: Numbers from 0.001 to 9999 are printed without an exponent (and the number of digits is actually only a suggestion, see format for details). Otherwise an &ldquo;engineering&rdquo; exponent is used (a multiple of 3).  
显着的数字显示的数字。默认2。如果0,在使用getOption("digits")。详细信息:数字0.0019999打印不带指数(数的数字其实只是一个建议,请参阅format)。否则,“工程”指数(3的倍数)。


参数:varlen
Length of variable names in text at the splits (and, for class responses, the class in the node label). Default -8, meaning truncate to eight characters. Possible values:<br> =0 use full names.<br> >0 call abbreviate with the given varlen.<br> <0 truncate variable names to the shortest length where they are still unique, but never truncate to shorter than abs(varlen).   
文本的分裂(对于类的反应,节点标签中的类)的变量名的长度。默认-8,这意味着截断为八个字符。可能的值:参考= 0使用的全名。参考> 0调用abbreviate给定的varlen。<0截断变量名以最短的长度,他们仍然唯一的,但从来没有截断较短的比abs(varlen)。


参数:faclen
Length of factor level names in splits. Default 3, meaning abbreviate to three characters. Possible values are as varlen above, except that 1 is treated specially, meaning represent the factor levels with alphabetic characters (a for the first level, b for the second, etc.).  
分裂因子的级别名称的长度。默认3,意为abbreviate三个大字。可能的值是varlen以上,除了1经过特殊处理,这意味着代表因子水平与字母字符(a的第一级,b第二,等等)。


参数:cex
Default NULL, meaning calculate the text size automatically.  
默认NULL,自动计算文字大小。


参数:tweak
Adjust the (possibly automatically calculated) cex. Default 1, meaning no adjustment. Use say tweak=1.2 to make the text 20% larger. Note that font sizes are discrete, so the cex you ask for may not be the cex you get. And a small tweak may not actually change the type size or change it more than you want.  
调整(可能自动计算)cex的。默认1,这意味着没有调整。用说tweak=1.2使文本20%以上。需要注意的是字体的大小是不连续的,所以cex你要求未必是cex你的。一个小的调整可能不会真正改变类型的大小或比你更想改变它。


参数:compress
If TRUE (the default), make more space by shifting nodes horizontally where space is available. This often allows larger text. (This is the same as plot.rpart's argument of the same name, except that here the default is TRUE.)  
如果TRUE(默认值),使更多的空间,通过移动节点的水平位置的可用空间。这往往使较大的文本。 (这是plot.rpart的参数相同的名称一样,只是,这里的默认值是TRUE)。


参数:ycompress
If TRUE (the default unless uniform=FALSE), make more space by shifting labels vertically where space is available. Actually, this only kicks in if the initial automatically calculated cex is less than 0.7. Use ycompress=FALSE if you feel the resulting display is too messy. In the current implementation, the shifting algorithm works a little better (allowing larger text) with type=1, 2, or 3.   
如果TRUE(默认情况下,除非uniform=FALSE),垂直移位标签的可用空间,腾出更多的空间。其实,这只是踢中如果初始自动计算cex小于0.7。使用ycompress=FALSE,“如果你觉得显示的结果是太乱了。在当前的实现,移算法的工作好一点type=1,2或3(允许较大的文本)。


参数:trace
Default FALSE. Use TRUE to print the automatically calculated cex, xlim, and ylim. Use integer values greater than 1 for more detailed tracing.<br>  
默认FALSE。使用TRUE要打印的自动计算cex,xlim和ylim。使用整数的值大于1的更详细的跟踪。<BR>


参数:snip
Default FALSE. Set TRUE to interactively trim the tree with the mouse. See ../doc/prp.pdf (or just try it).  
默认FALSE。设置TRUE以交互方式修剪的树,用鼠标。请参阅.. / DOC / prp.pdf的(或只是尝试一下)。


参数:snip.fun
Function invoked after each mouse click when snip=TRUE. Default NULL, meaning no function. Otherwise set snip.fun to your own function with the prototype function(tree), where tree is the snipped tree. See ../doc/prp.pdf for an example.  The following control the node labels.  
函数被调用后,每点击一下鼠标时snip=TRUE。默认NULL,这意味着没有任何功能。否则snip.fun到你自己的函数的原型function(tree),其中tree是剪断树的。 .. / DOC / prp.pdf的一个例子。下面的控制节点的标签。


参数:box.col
Color of the boxes around the text. Default 0, meaning use the background color.  
颜色的框周围的文字。默认0,意思是使用的背景颜色。


参数:border.col
Color of the box border around the text. Default col, the color of the text in the box. Use 0 for no border. (Note: par settings like col can be passed in as ... arguments. If not passed in, par("col") is used.)  
周围的文本框的边框颜色。默认col“中的文本框的颜色。使用0为无边框。 (注:par设置,如col可以通过在...的参数,如果没有通过,par("col")使用。)


参数:round
Controls the rounding of the corners of the node boxes. Default NULL, meaning calculate automatically. Else specify 0 for sharp edges, and values greater than 0 for rounded edges. Bigger is more round. Values too big for the box get silently reduced. (TODO clarify.)  
控制的节点框的角部的舍入。默认NULL,意思是自动计算。其他指定0锋利的边缘,和值大于0圆润的边角。更大更圆。值过大的箱子得到静静地减少。 (TODO澄清。)


参数:leaf.round
Controls the rounding of the corners of the leaf node boxes. Default NULL, meaning use round. Else specify a value greater than or equal to 0.  
控制该叶节点的框的角部的舍入。默认NULL,,意味着使用round。品指定的值大于或等于0。


参数:shadow.col
Color of the shadow under the boxes. Default 0, no shadow. Try "gray" or "darkgray". (Note: overlapping shadows look better on devices that support alpha channels. If you get the message "Warning: semi-transparency is not supported" please let me know &mdash; it means that a fix is needed to the code that determines if the device supports alpha channels.)  
颜色的框的阴影下。默认0,也没有影子。尝试"gray"或"darkgray"。 (注:重叠阴影的设备上更好看,支持alpha渠道。如果你得到消息“警告:不支持半透明度”请让我知道 - 这意味着需要一个固定的代码确定设备支持alpha通道)。


参数:prefix
Default "". Prepend this string to the node labels. So could be the name of the fitted response, for instance.  
默认""。前面加上这个字符串的节点标签。因此可能会受到的拟合响应的名称,例如。


参数:suffix
Default "". Append this string to the node labels. Text after a double newline "\n\n" (if any) will be plotted under the box. (Actually, double newlines can be used in any of the prefix or suffix arguments for this purpose.)  
默认""。追加这个字符串节点标签。文本后一个双换行"\n\n"(如果有的话)将被绘制框下。 (实际上,双换行符可以用于在任何的前缀或后缀参数用于此目的。)


参数:xsep
String which separates the individual counts and probabilities in node labels when extra>0. Default NULL meaning automatically select: usually<br> "  " (two spaces), but " / " for rates. Use xsep="/" for compatibility with text.rpart. See also facsep, which separates the factor levels in split labels.<br>  The following control the text under the boxes (apply only if under=TRUE or there is a double newline \n\n in prefix or suffix).  
分离单个节点标签的数量和概率的字符串时extra>0。自动选择默认为空的意义:通常<BR> "  "(两个空格),但" / "率。使用xsep="/":的兼容性与text.rpart的。请参阅facsep,分离因子水平的分割标签。<br>以下控制下的文本框(适用于只有under=TRUE或有一个双换行\n\n中 prefix或suffix)。


参数:under.font
Font of the text under the box. Default font (which can be passed in as a ... argument).  
下面的文本框的字体。默认font(这可以通过在...参数)。


参数:under.col
Color of the text under the box. Default 1.  
下面的文本框的颜色。默认1。


参数:under.cex
Size of the text under the box relative to the text in the box. Default .8, smaller than the text in the box.<br>  The following control the split labels.  
相对于文本框中输入的文本框下的大小。默认.8,小于中的文本框。<br>以下控制分割标签。


参数:split.cex
Size of the split text relative to cex (which by default is calculated automatically). Default 1.  
大小分割文本相对于cex(默认情况下自动计算)。默认1。


参数:split.font
Font for the split labels. Default 2, bold. (Note: use font to change the node label text.)  
分割标签的字体。默认2,大胆。 (注:使用font更改节点的标签文本。)


参数:split.family
Font family for the split labels. Default "", or use something like split.family="serif". (Note: use family to change the node label text.)  
分割标签的字体系列。默认"",或使用类似split.family="serif"。 (注:使用family更改节点的标签文本。)


参数:split.col
Color of the split label text. Default 1. (Note: use col to change the node label text.)  
分割的标签文本的颜色。默认1。 (注:使用col更改节点的标签文本。)


参数:split.box.col
Color of the split boxes. Default 0, meaning use the background color.  
的分裂框的颜色。默认0,意思是使用的背景颜色。


参数:split.border.col
Color of the split box borders. Default 0, invisible.  
分割边框的颜色。默认0,无形的。


参数:split.lty
Line type for the split box borders. The default is 1, but the border will be invisible unless you change the default split.border.col. (Note: use lty to change the node box borders.)  
分割边框的线条类型。默认值是1,但边界将是不可见的,除非您更改默认的split.border.col。 (注:使用lty更改节点的边框。)


参数:split.lwd
Line width of the split box border relative to cex (which by default is calculated automatically). The border is by default invisible, see codesplit.border.col.  
拆分框的边框线宽度相对于cex(默认情况下自动计算)。边框默认情况下是看不见的,看见codesplit.border.col。


参数:split.round
Controls the rounding of the corners of the split boxes. Default 0, meaning sharp corners. Else specify a value greater than or equal to 0. The split boxes are by default invisible, see split.box.col and split.border.col).  
控制的分裂框的角部的舍入。默认0,这意味着尖角。品指定的值大于或等于0。拆分框默认情况下是不可见的,看到split.box.col和split.border.col“)。


参数:split.shadow.col
Color of the shadow under the split boxes. Default 0, no shadow.  
颜色分割框的阴影下。默认0,也没有影子。


参数:split.prefix
Default "". Prepend this string to the split labels.  
默认""。前面加上这个字符串分割标签。


参数:right.split.prefix
Default split.prefix. Prepend this string to the right split labels. Applies only when type=3 or 4.  
默认split.prefix。右分割标签前面加上这个字符串。仅适用于当type=3或4。


参数:split.suffix
Default "". Append this string to the split labels.  
默认""。追加字符串分割标签。


参数:right.split.suffix
Default split.suffix. Append this string to the right split labels. Applies only when type=3 or 4.  
默认split.suffix。追加这个字符串右分割标签。仅适用于当type=3或4。


参数:facsep
Default ",". String which separates the factor levels in split labels. See also xsep, which separates the individual counts when extra is used.  
默认","。分离因子水平的分割标签的字符串。参见也xsep,分离个别计数,当extra使用。


参数:eq
Default " = ". String which separates the factor name from the levels in split labels. The idea is that you can add or remove spaces around the =, or use words if that suits you.  
默认" = "。分离因素的水平分割标签名称的字符串。我们的想法是,如果适合你,你可以添加或删除空格周围的=,或使用的词语。


参数:lt
Default " < ". String which represents &ldquo;less than&rdquo; in split labels.  
默认" < "。 String,它表示“小于”分割标签。


参数:ge
Default " >= ". String which represents &ldquo;greater than or equal&rdquo; in split labels.<br>  The following control the branches.  
默认" >= "。字符串代表“大于或等于”在裂标签。<br>以下控制的分支机构。


参数:branch.col
Color of the branch lines. Default 1, but set to "gray" if branch.type is nonzero.  
分支线的颜色。默认1,但"gray"如果branch.type是非零。


参数:branch.lty
Branch line type. Default 1.  
支线类型。默认1。


参数:branch.lwd
Line width of the branch lines relative to cex (which by default is calculated automatically). (Note: branch.lwd does not control the width of the &ldquo;wide branches&rdquo; drawn when branch.type is nonzero.)  
相对于cex(默认情况下自动计算)的分支线的线宽度。 (注:branch.lwd不控制它的宽度时branch.type是非零的“宽分支”绘制)。


参数:branch.type
Default 0. If nonzero draw &ldquo;wide branches&rdquo;, with branch widths proportional to the parameter selected by branch.type as follows:  0 The default.  The branch lines are drawn conventionally.<br> 1 deviance<br> 2 sqrt(deviance)<br> 3 deviance / nobs<br> 4 sqrt(deviance / nobs) (the standard deviation when method="anova")<br> 5 weight (frame$wt). This is the number of observations at the node, unless rpart's weight argument was used.<br> 6 complexity<br> 7 abs(predicted value)<br> 8 predicted value - min(predicted value)<br> 9 constant (for checking visual perception of the relative width of branches).<br>  Otherwise set branch.type to your own function. The function should take a single argument x (the rpart object) and return a numeric vector of non-negative widths corresponding to rows in frame. See get.branch.widths in the source code.  Note: with a nonzero branch.type, in the current implementation the branch argument will be silently changed to 1 (if branch > .5) or 0 (if branch < .5)<br>  
默认0。如果非零抽奖“广泛的分支”,与分支宽度比例branch.type如下:0默认选择的参数。分支线画传统。<BR>1越轨参考2的SQRT(偏差)参考3越轨行为/ NOBS参考4SQRT(偏差/ NOBS)(标准偏差method="anova")参考5重量(frame$wt)。这是若干意见的节点,除非rpart的weight参数。<BR> 6复杂<BR>的7ABS(预测值)< BR> 8预测值 - 分(预测值)参考9不变(检查视觉感知的相对宽度的分支)。<BR>否则将branch.type你自己的功能。该功能应采取单一的参数x(rpart对象),并返回一个数值向量非负宽度对应的行frame。 get.branch.widths的源代码。注意:对于一个非零branch.type,在当前的实现branch参数会被悄悄地改为1(如果如果branch > .5)0( X>)参考


参数:branch.tweak
Default 1. Applies only if branch.type is nonzero. Use this argument to scale the widths of the branches, for example, branch.tweak=.5 to halve the width of the branches. (By default, prp normalizes the widths so the widest branch is one-fifth the plot width.)  
默认1。只适用于branch.type是非零的。使用这种说法规模的分支机构的宽度,例如,branch.tweak=.5的宽度减少一半的树枝。 (默认情况下,prp标准化的宽度,使最广泛的分支图宽度的五分之一)。


参数:min.branch.width
Default 0.002. Applies only if branch.type is nonzero. The minimum width of a branch, as a fraction of the page width. The width of branches that would be thinner than min.branch.width is clamped. Increase min.branch.width if the thinnest branches are too skinny on your display device.  
默认0.002。只适用于branch.type是非零的。的一个分支,最小宽度为页面宽度的一小部分。宽度的分支,将厚度小于min.branch.width的夹紧。增加min.branch.width如果您的显示设备上最薄的分支太瘦了。


参数:branch.fill
Color used to fill the wide branch lines. Applies only if branch.type is nonzero. Default branch.col.<br>  The following control the node numbers (with nn=TRUE).  
使用的颜色填补了广泛的分支线。只适用于branch.type是非零的。默认branch.col。<br>以下控制节点号(与nn=TRUE)。


参数:nn.cex
Default NULL, meaning calculate the cex of the node numbers automatically. This and the following arguments apply only when nn=TRUE.  
默认NULL,自动计算cex的节点号。这和下面的参数只适用于当nn=TRUE。


参数:nn.font
Font for the node numbers. Default 3, italic.  
字体为节点的数字。默认3,斜体。


参数:nn.family
Font family for the node numbers. Default "".  
字体家庭的节点号。默认""。


参数:nn.col
Color of the node number text. Default 1.  
节点文本的颜色。默认1。


参数:nn.box.col
Color of the boxes around the node numbers. Default 0, meaning use the background color.  
周围的节点号码的框的颜色。默认0,意思是使用的背景颜色。


参数:nn.border.col
Color of the box border around the node numbers. Default nn.col.  
颜色框的边框周围的节点号。默认nn.col。


参数:nn.lty
Line type of the node number box border. Default 1.  
类型的节点数量框的边框线。默认1。


参数:nn.lwd
Line width of the node box border relative to cex (which by default is calculated automatically). Default NULL, meaning use lwd (which can be passed in as a ... argument).  
相对于cex(默认情况下自动计算)的节点框的边框线宽度。默认NULL,这意味着使用lwd(这可以通过在...参数)。


参数:nn.round
Controls the rounding of the corners of the node number boxes. Default .3, meaning small corners. Else specify a value greater than or equal to 0.<br>  The following are user definable functions.  
控制舍入节点号框的角部。默认.3,这意味着小角落。否则指定的值大于或等于0。<br>以下是用户自定义功能。


参数:node.fun
The function that generates the text at the node labels. The default is internal.node.labs, which specifies a function internal to prp. This is necessary for full support of extra as described in the section on extra above.<br> Otherwise set node.fun to your own function with the prototype function(x, labs, digits, varlen). See ../doc/prp.pdf for details.  
生成文本的函数,该函数在节点的标签。默认的是internal.node.labs,指定一个函数内部的prp。这是必要的全力支持extra extra以上的部分所描述的参考,否则node.fun你自己的函数的原型function(x, labs, digits, varlen)。的详细信息,请参阅/ DOC / prp.pdf的。


参数:split.fun
The function that generates the text at the splits. Default internal.split.labs, which specifies a function internal to prp. Otherwise set split.fun to your own function with the prototype function(x, labs, digits, varlen, faclen)  
的功能,生成文本的分裂。默认internal.split.labs,指定的内部prp。否则,设置split.fun自己的功能用的原型function(x, labs, digits, varlen, faclen)


参数:FUN
The function that displays the text on the screen. Default text.<br>  The following are esoteric parameters, mostly for the graph layout engine.  
在屏幕上显示文本的函数。默认text。<br>以下是深奥的参数,主要用于图形布局引擎。


参数:nspace
Applies only when compress=TRUE. Default nspace=branch. The size of the space between a split and a leaf, relative to the space between leaves.  
仅适用于当compress=TRUE。默认nspace=branch。分裂和叶,叶片之间的空间相对之间的空间的大小。


参数:minbranch
Applies only when uniform=FALSE.  Default .3. The minimum height between levels is clamped at minbranch times the mean interlevel distance. Needed because sometimes a split gives little or no improvement in deviance, and an interlevel distance strictly proportional to the improvement would leave no room for the label.  
仅适用于当uniform=FALSE。默认.3。被钳位在minbranch倍的平均层间距离之间的水平的最小高度。需要,因为有时分裂提供了很少或根本没有改善的越轨行为,严格比例的提高层间的距离留下任何余地的标签。


参数:do.par
Default TRUE, meaning adjust the mar parameter so the tree fills the figure region. This also sets xpd=NA. These graphic parameters are restored to their original state before prp exits. If you explicitly set mar or xpd, prp will use your setting regardless of the setting of do.par.  
默认TRUE,调整mar参数,所以树填充图区域。这还设置xpd=NA。前的prp退出这些图形参数恢复到原来的状态。如果你明确地设置mar或xpd,prp将使用的设置do.par不管您的设置。


参数:add.labs
Default TRUE, meaning display the labels. If FALSE, gives a bare bones display similar to plot.rpart.  
默认TRUE,意思是显示在标签上。如果FALSE,给出了一个光秃秃的骨头显示类似plot.rpart。


参数:clip.left.labs
Like clip.right.labs but for the left labels. Default is FALSE. Note that clip.left.labs and clip.right.labs can be vectors, indexed on the split number.  
clip.right.labs但左边的标签。默认是FALSE。需要注意的是clip.left.labs和clip.right.labs可以是向量,索引分割数。


参数:fam.main
Font family for the main text.  Default "". The (inconsistent) name was chosen to minimize partial matching with main and family which can be passed in as a which can be passed in as ... arguments.  
字体家庭的主要文本。默认""。 (不一致)的名字,是为了最大限度地减少main和family这可以通过在作为一个可以通过在作为部分匹配...参数。


参数:yshift
Vertical position of the labels, in character heights relative to their default position. Default 0. Negative values move the text down; positive up (the box around the text will follow along).  
的标签,相对于它们的默认位置的字符高度的垂直位置。默认0。负值将文本向下,积极向上(文本周围的框会跟随)。


参数:space
Horizontal space to the box border on each side of the node label text, in character widths. Default 1. Use this (and yspace) for bigger boxes. Since this affects the size of the (possibly invisible) boxes, it also affects the graph layout and hence also the automatic calculation of cex.  
水平空间的每一侧上的节点的标签文本框的边框,在字符宽度。默认1。使用这个(和yspace)大箱。因为这会影响的(可能是不可见的)框的大小,它也影响的图形布局,并因此也自动计算cex。


参数:yspace
Vertical space to the box border above and below the node label text, in character heights. Default space. See the comments for space.  
的上面和下面的节点标签文本框的边框的垂直空间,在字符的高度。默认space。见的评论space。


参数:shadow.offset
Offset of the shadow from the boxes, in character widths. Default .4 (but the shadow will be invisible unless the default shadow.col is changed).  
从盒子的阴影的偏移量,在字符宽度。默认.4(但阴影将是不可见的,除非默认shadow.col改变)。


参数:split.adj
Horizontal position of the split text. In string width units, as is the convention for adj arguments. Default NULL, meaning use adj (which defaults to 0.5 but can be passed in as a ... argument). Use values less/more than .5 to shift the text left/right (the box around the text will follow along).  
分割文字的水平位置。在字符串宽度单位,是adj参数的约定。默认NULL,这意味着使用adj(默认为0.5但可以通过在...参数)。使用的值以下/以上.5,转移的文本左/右(文本周围的框会跟随)。


参数:split.yshift
Vertical position of the split labels, in character heights relative to their default positions. Default 0. Negative values move the text down; positive up (the box around the text will follow along). This adjusts the positions of the split labels relative to the node labels. (Use yshift if you want to shift both the split and node labels.)  
分割标签,相对于它们的默认位置的字符高度的垂直位置。默认0。负值将文本向下,积极向上(文本周围的框会跟随)。这调整分割相对于节点的标签的标签的位置。 (使用yshift,“如果你想转移的分裂和节点标签。)


参数:split.space
Horizontal space between the split label text and the box, in character widths. Default space. Affects the size of the box drawn around the text. The split boxes are by default invisible (see split.box.col and split.border.col), but nevertheless affect the graph layout used in the automatic calculation of cex.  
分割的标签文字和框的水平间距,字符宽度。默认space。影响周围绘制的文字的框的大小。拆分框默认情况下不可见的(见split.box.col和split.border.col),但仍然影响自动计算cex在使用图形布局。


参数:split.yspace
Vertical space between the split label text and the box, in character heights. Default yspace.  
之间的垂直空间的分割标签文本框中,在字符的高度。默认yspace。


参数:split.shadow.offset
Offset of the shadow from the split boxes, in character widths. Default shadow.offset. (but the shadow will be invisible unless the default shadow.col is changed).  
拆分框的阴影的偏移量,字符宽度。默认shadow.offset。 (但阴影将是不可见的,除非默认shadow.col改变)。


参数:nn.adj
Horizontal position of the node label text. Default .5.  
节点标签文本的水平位置。默认.5。


参数:nn.yshift
Vertical position of the node numbers, in character heights relative to their default positions. Default 0.  
垂直位置的节点号,字符高度相对于它们的默认位置。默认0。


参数:nn.space
Horizontal space to the box border on each side of the node number text, in character widths. Default .8.  
水平空间的每一侧上的节点号文本框的边框,在字符宽度。默认.8。


参数:nn.yspace
Vertical space to the box border above and below the node number text, in character heights. Default .5.  
的垂直空间的上方和下方的节点号文本框的边框,在字符的高度。默认.5。


参数:under.ygap
Applies if text is plotted under the box (i.e. if under=TRUE or there is a double newline in prefix or suffix). Vertical gap (in char heights) between the lower edge of the box and the top of the text under the box.  
如果绘制文本框下(即如果under=TRUE或有双换行prefix或suffix)。框的下边缘和下的文本框的顶部之间的垂直间隙(在char的高度)。


参数:yesno.yshift
Vertical position of "yes" and "no" in character heights relative to their default position. Default 0. Applies only when yesno=TRUE.  
“是”和“否”相对于它们的默认位置的字符高度的垂直位置。默认0。仅适用于当yesno=TRUE。


参数:ygap
Minimum vertical gap between boxes, in character heights. Default gap/2.  
在箱子之间的最小垂直间距,字符高度。默认gap/2。


参数:xcompact
If TRUE (the default) and there is too much white space, automatically change xlim to compact the entire tree horizontally. This usually only activates for small trees. (The xcompact and ycompact arguments compact the tree as a whole, whereas the compress and ycompress arguments move parts of the tree into available space.)  
如果TRUE(默认值),有太多的空白,自动改变xlim压缩整个目录树的水平。这种情况通常只激活小乔木。 (xcompact和ycompact参数紧凑的树作为一个整体,而compress和ycompress参数移动树的部分可用空间)。


参数:ycompact
If TRUE (the default) and there is too much vertical space, automatically change ylim to compact the entire tree vertically.  
如果TRUE(默认值),有太多的垂直空间,自动改变ylim垂直压缩整个目录树。


参数:xcompact.ratio
Default .8. Applies only when xcompact=TRUE. The maximum possible without overplotting is 1, but compacting by .8 usually gives more pleasing spacing (it gives more space).  
默认.8。仅适用于当xcompact=TRUE。最大的可能而不overplotting,1,但压缩的。“.8通常提供了更加赏心悦目的间距(它提供了更多的空间)。


参数:min.inter.height
Default 4. Applies only when ycompact=TRUE. Minimum height (in units of character height) between the lowest label in a layer and the highest label in the layer below it.  
默认4。仅适用于当ycompact=TRUE。最低高度(字符高度单位)中的层和在它下面的层中的最高的标签之间的最低层次的标签。


参数:max.auto.cex
Clamp the maximum automatically calculated cex at this value Default 1, meaning never expand cex, only contract when necessary.  
夹自动计算的最大cex在这个值默认1,这意味着从来没有扩大cex,只有合同时,必要。


参数:min.auto.cex
Default .15. Never downscale to less than this when automatically calculating cex, even if overplotted labels result. (The graph layout algorithm is unstable with cex's below 0.15 &mdash; meaning that the automatic type size may be smaller than necessary.)  
默认.15。不要下限达不到这个时自动计算cex,即使overplotted标签的结果。 (图布局算法是不稳定的cexs以下0.15“ - 这意味着自动类型的大小可能会小于必要。)


参数:ycompress.cex
Default .7. Applies only when ycompress=TRUE. Apply the ycompress algorithm if the initial automatically calculated cex is less than this. The idea is that we don't want to shift if we get an acceptable cex without shifting. Make Inf to always attempt shifting.  
默认.7。仅适用于当ycompress=TRUE。如果最初的自动计算ycompress小于这个应用cex算法。我们的想法是,我们不希望转移,如果我们得到一个可以接受的CEX没有转移。让Inf总是试图转移。


参数:accept.cex
Accept shifting only if it causes at least this much improvement in cex (because we don't want to shift if it gives only a small improvement in cex). Default 1.1 i.e. require at least a 10% improvement. Use 0 to always accept shifts and Inf to never accept (or use ycompress=FALSE).  
接受转移,只有当它cex(至少有这么多改进,因为我们不希望转移,如果它仅提供了小的改进CEX)。默认1.1即需要至少10%的改善。使用0总是接受的变化和Inf从来没有接受(或使用ycompress=FALSE)。


参数:shift.amounts
Default c(1.5, 2, 3). For ycompress, choose the best cex yielded by shifting nodes by these amounts, in multiples of the box heights (after initial scaling).  
默认c(1.5, 2, 3)。对于ycompress,选择最佳的cex所产生的移动节点的金额,在框的高度(经初步缩放)的倍数。


参数:Fallen.yspace
Extra space for fallen leaves. Default .1, meaning allow 10% of the vertical space for the fallen leaves. (The name Fallen.yspace uses upper case to avoid partial matching with fallen.leaves.)  
落叶的额外空间。默认.1,意思是让10%的垂直空间的落叶。 (Fallen.yspace使用大写,以避免部分匹配fallen.leaves)。


参数:boxes.include.gap
Default FALSE. Draw the boxes to include gap and ygap, for debugging. This only affects the way the boxes are drawn, not the graph layout algorithm in any way. With the optimum cex at least one pair of boxes displayed in this manner will just touch (but none will overlap).  
默认FALSE。画的框,包括gap和ygap,用于调试。这只会影响的框画,不以任何方式图形布局算法。与最佳cex至少一对以这种方式显示的框将刚刚接触(但没有将重叠)。


参数:...
Extra par arguments.  Only the &ldquo;important&rdquo; par arguments are supported. Note that arguments like col apply only to the node labels. To affect the split labels or branch lines, use split.col and branch.col instead.  
额外par参数。只有“重要的”par参数的支持。需要注意的是参数,如col只适用于节点的标签。要影响的的分割标签或分支线,使用split.col和branch.col代替。


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

A list with the following components. With the default args most of these are automatically calculated.
与以下组件的列表。使用默认的ARGS这些都是自动计算的。


参数:obj
The rpart object. Identical to the x argument passed in unless snip was used.
rpart对象。 x参数传递,除非snip使用。


参数:snipped.nodes
The snipped nodes, NULL unless snip was used.
剪断节点,NULL除非snip使用。


参数:xlim, ylim
The graph limits.
该图的限制。


参数:x, y
The node coords.
节点坐标。


参数:branch.x, branch.y
The branch line coords.
的支线坐标。


参数:labs
The node labels.
节点的标签。


参数:cex
The node label cex.
节点标签cex。


参数:boxes
The coords of the boxes around the nodes.
节点周围的框的coords。


参数:split.labs
The split labels.
分割的标签。


参数:split.cex
The split label cex.
分割标签cex。


参数:split.boxes
The coords of the boxes around the splits.
周围的框分割的坐标。


注意----------Note----------

Please see ../doc/prp.pdf for an overview. (If your help system does follow that link correctly, please follow the link on this package's Index page.)
请参阅.. /的DOC / prp.pdf为一个概述。 (如果您的帮助系统,这个链接正确,请按照这个包的索引页面的链接。)


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

../doc/prp.pdf<br> rpart.plot<br> plot.rpart<br> text.rpart<br> rpart
是。/ DOC / prp.pdf的<BR>rpart.plot参考plot.rpart参考text.rpart参考rpart


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


data(ptitanic)
tree <- rpart(survived ~ ., data=ptitanic, cp=.02)
                         # cp=.02 because want small tree for demo[CP = 0.02,因为要小的树演示]

old.par <- par(mfrow=c(2,2))
                         # put 4 figures on one page[在一个页面上放4个数字]

prp(tree, main="default prp\n(type = 0, extra = 0)")

prp(tree, main="type = 4,  extra = 6", type=4, extra=6, faclen=0)
                         # faclen=0 to print full factor names[faclen = 0打印全因子名称]

cols <- ifelse(tree$frame$yval == 1, "darkred", "green4")
                         # green if survived[绿色存活]

prp(tree, main="assorted arguments",
    extra=106,           # display prob of survival and percent of obs[显示开放式保税仓的生存和%的概率]
    nn=TRUE,             # display the node numbers[显示节点号]
    fallen.leaves=TRUE,  # put the leaves on the bottom of the page[把页面底部的叶片上]
    branch=.5,           # change angle of branch lines[改变角度的分支线]
    faclen=0,            # do not abbreviate factor levels[不要缩写因子水平]
    trace=1,             # print the automatically calculated cex[打印自动计算的CEX]
    shadow.col="gray",   # shadows under the leaves[叶下的阴影]
    branch.lty=3,        # draw branches using dotted lines[用虚线画分支机构]
    split.cex=1.2,       # make the split text larger than the node text[文本分割大于节点文本]
    split.prefix="is ",  # put "is " before split text[把“是”之前分割文本]
    split.suffix="?",    # put "?" after split text[把“?”分割后的文本]
    col=cols, border.col=cols,   # green if survived[绿色存活]
    split.box.col="lightgray",   # lightgray split boxes (default is white)[浅灰色分割框(默认为白色)]
    split.border.col="darkgray", # darkgray border on split boxes[的深灰边界上分割盒]
    split.round=.5)              # round the split box corners a tad[圆的拆分框角一点点]

# the old way for comparison[旧的方式进行比较]
plot(tree, uniform=TRUE, compress=TRUE, branch=.2)
text(tree, use.n=TRUE, cex=.6, xpd=NA) # cex is a guess, depends on your window size[CEX是一个猜测,取决于你的窗口大小]
title("plot.rpart for comparison", cex=.6)

par(old.par)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-13 04:14 , Processed in 0.034357 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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