Re: [R] Creating a .png with just an expression() in it

From: baptiste auguie <baptiste.auguie_at_googlemail.com>
Date: Sat, 05 Mar 2011 10:15:26 +1300

Hi,

I think the easiest way is to use grid graphics,

library(grid)

a = 0.3
b = pi
e = bquote(y[alpha] == .(a) * x[beta]+ .(round(b,2)))

grid.newpage()
grid.text(e)

## if you wanted a snug fit with the device window

e2 = expression(integral(frac(1, alpha + x[beta])*dx, -infinity, +infinity)) g = textGrob(e2)

w = grobWidth(g)
h = grobHeight(g)

dev.new(width=convertUnit(w, "in", valueOnly=TRUE),

        height = convertUnit(h, "in", "y", valueOnly=TRUE))

grid.draw(g)

HTH, baptiste

On 5 March 2011 02:31, Alexx Hardt <mikrowelle1234_at_gmx.de> wrote:
> Hey,
> I'm trying to create an image file with the results of a regression
> analysis. In TeX, the line would be something like:
> $ size = 0.34 + 4.3 var_1 $
>
> Can I create a plot window with just this line in it? I tried playing around
> with plot.new() or dev.new(), but didn't really find something that worked.
>
> Thanks in advance,
>  Alex
>
> --
> alexx_at_alexx-fett:~$ vi .emacs
>
> ______________________________________________
> 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.
>



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. Received on Fri 04 Mar 2011 - 21:18:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 04 Mar 2011 - 21:20:20 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive