简体   繁体   中英

Plotting a Data Frame (no grid.table)

The question of today is pretty simple. I need to plot a Data frame so it shows in the plot viewer in R studio.

I read this Q&A already:

How to print (to paper) a nicely-formatted data frame

Where they are advising to use grid.table from GridExtra package.

The thing is that im having problem with this package as is overlapping my other plots I dont know why?

Maybe you know any other functions or package that can do the same without overlapping my other plots!

This is what I mean by overlapping.

> date_alert
          Jobs    Agency Location       Date RXH HS TMM Payed
1  Playstation Lightblue     DWTC 2015-09-24  90  8 720 FALSE
2 RWC Heineken Lightblue      EGC 2015-09-26  90  6 540 FALSE
3 Jagermeister       IHC  Barasti 2015-10-01 100  4 400 FALSE


> library(gridExtra)
> grid.table(date_alert)

在此处输入图片说明

It does that all the time! no matter how many times I restart all the script and R studio.

Thanks

If you want to plot a grid grob to a new page you need to create a new page first. The example in help("grid.table") demonstrates how to do that:

library(grid)
grid.newpage()

Note that many higher level grid-based plotting functions, such as ggplot2:::print.ggplot call grid.newpage internally. But grid.table doesn't since the common use case is adding a table to a plot. There are better possibilities if your goal is exporting just a table.

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