I am moving away from Word/Excel tables and trying to generate a table in R. I have a data frame that I\'d like to simply print as a plot, while being able
Since I am going for the bonus points:
#Plot your table with table Grob in the library(gridExtra)
ss <- tableGrob(x)
#Make a scatterplot of your data
k <- ggplot(x,aes(x=x$"Value 1",y=x$"Value 2")) +
geom_point()
#Arrange them as you want with grid.arrange
grid.arrange(k,ss)
You can change the number of rows, columns, height and so on if you need to.
Good luck with it
http://cran.r-project.org/web/packages/gridExtra/gridExtra.pdf
Try this. Yes use pdf()
to plot a PDF file (e.g. mydf.pdf
) or png()
to plot a png file:
library(gridExtra)
pdf("mypdf.pdf", height=6, width=4)
grid.table(x)
dev.off()