[R] exporting text output to pdf
baptiste auguie
baptiste.auguie at googlemail.com
Tue Jan 19 10:46:58 CET 2010
Hi,
You could play with the splitTextGrob() function from the RGraphics package,
string <- "Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Quisque leo ipsum, ultricies scelerisque volutpat non, volutpat et
nulla. Curabitur consequat ullamcorper tellus id imperdiet. Duis
semper malesuada nulla, blandit lobortis diam fringilla at. Vestibulum
nec tellus orci, eu sollicitudin quam. Phasellus sit amet enim diam.
Phasellus mattis hendrerit varius. Curabitur ut tristique enim. Lorem
ipsum dolor sit amet, consectetur adipiscing elit. Sed convallis,
tortor id vehicula facilisis, nunc justo facilisis tellus, sed
eleifend nisi lacus id purus. Maecenas tempus sollicitudin libero,
molestie laoreet metus dapibus eu. Mauris justo ante, mattis et
pulvinar a, varius pretium eros. Curabitur fringilla dui ac dui rutrum
pretium. Donec sed magna adipiscing nisi accumsan congue sed ac est.
Vivamus lorem urna, tristique quis accumsan quis, ullamcorper aliquet
velit."
library(RGraphics)
g <- splitTextGrob(string)
grid.draw(g)
See also this ggplot2 thread for mixing this kind of basic text with
tables and graphics using only Grid functions,
http://groups.google.com/group/ggplot2/browse_frm/thread/808af3b15d54ef38/822d8c2296ef3447
I haven't seen mention here of asciidoc or brew, these two packages
might give you other options.
HTH,
baptiste
2010/1/18 Dimitri Shvorob <dimitri.shvorob at gmail.com>:
>
> ... You can modify this (dysfunctional) snippet.
>
> pdf()
> plot.new()
> mtext("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque leo
> ipsum, ultricies scelerisque volutpat non, volutpat et nulla. Curabitur
> consequat ullamcorper tellus id imperdiet. Duis semper malesuada nulla,
> blandit lobortis diam fringilla at. Vestibulum nec tellus orci, eu
> sollicitudin quam. Phasellus sit amet enim diam. Phasellus mattis hendrerit
> varius. Curabitur ut tristique enim. Lorem ipsum dolor sit amet, consectetur
> adipiscing elit. Sed convallis, tortor id vehicula facilisis, nunc justo
> facilisis tellus, sed eleifend nisi lacus id purus. Maecenas tempus
> sollicitudin libero, molestie laoreet metus dapibus eu. Mauris justo ante,
> mattis et pulvinar a, varius pretium eros. Curabitur fringilla dui ac dui
> rutrum pretium. Donec sed magna adipiscing nisi accumsan congue sed ac est.
> Vivamus lorem urna, tristique quis accumsan quis, ullamcorper aliquet
> velit.")
> mtext("A nice-looking paragraph! Now this is what I call good advice!")
> dev.off()
> --
> View this message in context: http://n4.nabble.com/exporting-text-output-to-pdf-tp837699p1017087.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
More information about the R-help
mailing list