[R] identify function with postscript output?
ihaka at stat.auckland.ac.nz
Thu Nov 13 18:57:52 CET 2003
> I want to select some points in a plot using 'identify' function
> and also want the identified points to be saved in a
> postscript file? Any help in how to do it?
> A better question might have been, how do i pipe the screen output
> to a postscript file?
You may want to look at the "pos" argument to "identify" and "text".
Specifying pos=TRUE as an argument to "identify" makes it add a "pos"
component to its return value. This can be passed as an argument "text"
to place the labels in new plots just as they appear in the on-screen
> # Onscreen
> y = rnorm(10)
> id = identify(y,pos=TRUE)
> # Later, for hardcopy
> text(1:length(y)[id$ind], y[id$ind], labels=id$ind, pos=id$pos)
That way you can capture the essential state of your on-screen plot,
but make revisions to the way in which its drawn.
Ross Ihaka Email: ihaka at stat.auckland.ac.nz
Department of Statistics Phone: (64-9) 373-7599 x 85054
University of Auckland Fax: (64-9) 373-7018
Private Bag 92019, Auckland
More information about the R-help