plot.rpart(rpart)
plot.rpart()所属R语言包:rpart
Plot an Rpart Object
绘制软件rpart对象
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Plots an rpart object on the current graphics device.
图当前图形设备上的软件rpart对象。
用法----------Usage----------
## S3 method for class 'rpart'
plot(x, uniform=FALSE, branch=1, compress=FALSE, nspace,
margin=0, minbranch=.3, ...)
参数----------Arguments----------
参数:x
a fitted object of class rpart, containing a classification, regression, or rate tree.
装一类对象rpart,包含分类,回归,或利率树。
参数:uniform
if TRUE, uniform vertical spacing of the nodes is used; this may be less cluttered when fitting a large plot onto a page. The default is to use a non-uniform spacing proportional to the error in the fit.
如果TRUE,统一垂直间距节点使用,这可能是装修时不凌乱到一个页面上的一个大图。默认的是使用非均匀间距成正比,在合适的错误。
参数:branch
controls the shape of the branches from parent to child node. Any number from 0 to 1 is allowed. A value of 1 gives square shouldered branches, a value of 0 give V shaped branches, with other values being intermediate.
从父到子节点控制树枝的形状。允许任何数量从0到1。值1提供方承担分支,值为0 V形分行,其他值中间。
参数:compress
if FALSE, the leaf nodes will be at the horizontal plot coordinates of 1:nleaves. If TRUE, the routine attempts a more compact arrangement of the tree. The compaction algorithm assumes uniform=TRUE; surprisingly, the result is usually an improvement even when that is not the case.
如果FALSE,叶节点是在横向的图1:nleaves坐标。如果TRUE例行试图树的安排比较紧凑。压缩算法假定uniform=TRUE;令人惊讶的是,结果通常是一个进步,即使是情况并非如此。
参数:nspace
the amount of extra space between a node with children and a leaf, as compared to the minimal space between leaves. Applies to compressed trees only. The default is the value of branch.
一个孩子的节点和叶之间的额外空间量相比,叶之间的最小空间。适用于仅压缩树木。默认是值branch。
参数:margin
an extra percentage of white space to leave around the borders of the tree. (Long labels sometimes get cut off by the default computation).
一个空白的额外百分比离开周围的树的边界。 (长的标签,有时会默认计算)。
参数:minbranch
set the minimum length for a branch to minbranch times the average branch length. This parameter is ignored if uniform=TRUE. Sometimes a split will give very little improvement, or even (in the classification case) no improvement at all. A tree with branch lengths strictly proportional to improvement leaves no room to squeeze in node labels.
设置一个分支minbranch倍,平均枝长的最小长度。如果uniform=TRUE此参数被忽略。有时分裂会给很少的改善,甚至(分类情况)没有任何改善。具有严格的比例,以改善树分支长度,叶无房挤在节点的标签。
参数:...
arguments to be passed to or from other methods. </table>
参数被传递到或从其他方法。 </ TABLE>
Details
详情----------Details----------
This function is a method for the generic function plot, for objects of class rpart. The y-coordinate of the top node of the tree will always be 1.
这个函数是一个方法,泛型函数plot类rpart的对象。树的顶端节点y坐标将始终为1。
值----------Value----------
The coordinates of the nodes are returned as a list, with components x and y.
节点的坐标返回一个列表,组件x和y。
副作用----------Side Effects----------
An unlabeled plot is produced on the current graphics device.
当前图形设备上产生的未标记的图。
参见----------See Also----------
rpart, text.rpart
rpart,text.rpart
举例----------Examples----------
fit <- rpart(Price ~ Mileage + Type + Country, cu.summary)
plot(fit, compress=TRUE)
text(fit, use.n=TRUE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|