简体   繁体   中英

Better visualization on Buckets in R

do you have any ideas on how to get a better visualization in the Buckets output? Because I'm going to put this report into PDF using Rmarkdown.

> 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? 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:

```{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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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