[R] get current window (device) size
Prof Brian Ripley
ripley at stats.ox.ac.uk
Mon Feb 15 15:35:55 CET 2010
On Mon, 15 Feb 2010, Edmond.Ng at lshtm.ac.uk wrote:
> Dear R-listers,
>
> I am writing a function that will generate a simple plot for the
> user . The size of the window (that contains the plot) may not be
> what the user wants.
>
> Supposing the user adjusts the window to a size of her/his choice, I
> would like to be able to save the new window size and specify the
> plot to be of this new window size when the user calls my function
> again. My question is what is the kind of 'get' or save graphic
> parameter command that I need to extract the size of the current
> window? I have looked at 'par' and 'getOption' but they don't seem
> to what I need.
>From the help for par:
‘din’ _*R.O.*_; the device dimensions, ‘(width,height)’, in
inches.
seems to be exactly what you are asking for.
(I'd be cautious about saving this across sessions: users may well use
R on different computers with a common file system.)
> Many thanks for any advice in advance.
>
> Best wishes,
> Edmond
>
>
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Edmond Ng, MSc CStat
> Lecturer in Medical Statistics
> Health Services Research Unit, London School Hygiene & Tropical Medicine, Keppel Street, London WC1E 7HT, UK
> Tel: +44 (0)20 7927 2366 (direct line: ext 2065) Fax: +44 (0)20 7580 8183
> (Room 35, Ground Floor, Malet Street side)
> Website: http://www.lshtm.ac.uk/hrsu
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list