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 to shade/colour cells and generally play with the aesthetics.
x <- data.frame(row.names=paste("Name",1:10))
x[,1] <- 1:10
x[,2] <- sample(1:100,10)
x[,3] <- sample(LETTERS[1:26],10)
colnames(x) <- c("Value 1", "Value 2", "Label")
Error in plot.default(...) : formal argument "type" matched by
multiple actual arguments
Try this. Yes use
pdf() to plot a PDF file (e.g.
png() to plot a png file:
library(gridExtra) pdf("mypdf.pdf", height=6, width=4) grid.table(x) dev.off()