2
votes

I am working with a script that looks something like this:

testplot <- plot(fit, uniform=TRUE, 
    main="Classification Tree for MRC")
text(fit, use.n=TRUE, all=TRUE, cex=.8)

post(fit, file = "tree.ps", 
    title = "Classification Tree")

I'm not that familiar with how R handles images/plotting, but is there any way to generate a png or pdf file of the image instead of postscript format? I see in some tutorials that the demo images are in PNG's, but they all only show the post method of saving the plot. Do I have to convert the image outside of the script?

1
have a look at ?pdf and ?pngNishanth
Possibly this question might also help?Adam Kimberley
Thanks, to both of you! That got me moving in the right direction :)rhae66
I don't know if it's appropriate to ask this here, but is there any documentation on how plot or text allocates margin space? There's one part of the the text in the png version of my plot that now gets cut off on the right side...rhae66
?par for margin allocation. Look mar and oma and xpd. Can also include "\n" for line-breaks/word-wrap.IRTFM

1 Answers

1
votes

My advice would be to consider using RStudio. It makes this very easy - there is a 'save image' button which allows you to specify the type of image (e.g., pdf, png, etc) and the size.