r - Create a PDF table -
is there way produce pdf of table r in same way produce plot (ie pdf() or ggsave())? realize there ways other programs (using sweave etc.), produce r.
yes there can place text graphs , hence pdf devices.
the nicest wrapper may textplot()
function in greg warnes' trusted gplots package. below beginning of examples section of page:
# show r version information textplot(version) # show alphabet single string textplot( paste(letters[1:26], collapse=" ") ) # show alphabet matrix textplot( matrix(letters[1:26], ncol=2)) ### make nice 4 way display 2 plots , 2 text summaries data(iris) par(mfrow=c(2,2)) plot( sepal.length ~ species, data=iris, border="blue", col="cyan", main="boxplot of sepal length species" ) plotmeans(sepal.length ~ species, data=iris, barwidth=2, connect=false, main="means , 95\% confidence intervals\nof sepal length species") info <- sapply(split(iris$sepal.length, iris$species), function(x) round(c(mean=mean(x), sd=sd(x), n=gdata::nobs(x)),2)) textplot( info, valign="top" ) title("sepal length species") reg <- lm( sepal.length ~ species, data=iris ) textplot( capture.output(summary(reg)), valign="top") title("regression of sepal length species") par(mfrow=c(1,1))
Comments
Post a Comment