简体   繁体   English

R中存储桶的可视化效果更好

[英]Better visualization on Buckets in R

do you have any ideas on how to get a better visualization in the Buckets output? 您对如何在Bucket输出中获得更好的可视化有任何想法吗? Because I'm going to put this report into PDF using Rmarkdown. 因为我要使用Rmarkdown将报告放入PDF。

> EZ_liftChart(predicted=dataL_V$probVal, actual=dataL_V$Bound_Count,
+              order=1,
+              weightp=c(1),
+              weighta=c(1),
+              weightb=c(1),
+              n.buckets= 10,
+              edgy=2,
+              size=1,
+              bind=1)

And this is the output of the buckets. 这是存储桶的输出。

bucket [,1]      
    1  -0.8125594
    2  -0.7590050
    3  -0.7189301
    4  -0.7188391
    5  -0.5047816
    6  -0.3439579
    7  -0.4376782
    8  -0.1300217
    9   0.9145718
    10  2.1844290
    11  4.8374356

I want the output to be a better table visualization. 我希望输出是更好的表可视化。 How can I use the kable or stargazer in Rmarkdown for this? 我该如何在Rmarkdown中使用有线或观星机? Or are there any other functions that could improve the output like changing the column header name of the 2nd column. 或者是否有其他功能可以改善输出,例如更改第二列的列标题名称。 Thanks. 谢谢。

I am not sure what you want. 我不确定你想要什么。 I suppose something like the table below? 我想像下面的表格吗?

在此处输入图片说明

This table can be produced with pander library: 该表可以使用pander库生成:

```{r, echo=FALSE}
library(pander)
x=matrix(c(-0.8125594,-0.7590050,-0.7189301,-0.7188391,-0.5047816,-0.3439579,-0.4376782,-0.1300217,0.9145718,2.1844290,4.8374356),ncol=1)
bucket=c(1:11)

df=data.frame(Variable1=bucket,Variable2=x)

pander(df,row.names=F,caption="Bucket Table",keep.line.breaks = TRUE)
```

Hope this helps 希望这可以帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM