[R] ? data.entry "read-only" ?

(Ted Harding) Ted.Harding at nessie.mcc.ac.uk
Mon Jan 12 23:40:06 CET 2004


Thanks, Brian, for these comments.

On 12-Jan-04 Prof Brian Ripley wrote:
> There are I believe three separate data displays behind data.entry (on 
> Xll, Windows and Aqua).  As far as I know none of them allow much 
> customization, or to be read-only.
> 
> I had thought about a read-only version of the first two, but then
> realized that people happily use spreadsheets for display, as well as
> data editors in several other packages.

Linux has no spreadsheet as standard, though you could get one by
installing some monster like StarOffice. In any case, any real
spreadsheet has much more functionality than one needs for data
editing, and more again than one needs merely for data display.

> What is more important is
> that the data editors are modal (at least the first two), so you
> cannot leave them open whilst working on a dataset, since you will not
> be able to get back to the prompt.

This is precisely why it's really danegrous! In order to get back to
the prompt you have to quit, so any unintended changes to the data get
written back to the data-set, and silently: you get no warning
if you've changed anything.

> Read-only non-modal versions might be worth pursuing.

Agreed. I've often used 'data.entry' to look at a data-set, and
of course it's inconvenient that you have to close it down in
order to get on with the job -- in particular losing your place
in the data. However, I've had a look at the R code and the C source,
and have not managed to work out where to make a change for this
purpose, nor even how to avoid the write-back on exit (since I've not
managed to determine the path from the entry arguments to wherever
it is that the function exits, so that the "return" could be
encapsulated in an "if(...){return;}" which tested for whether
a "read-only" option had been set.

However, as a result of looking a bit closer into it following
your comments, it now seems that invoking the associated function
'de' along the lines of

  junk<-de(dataset)

would do: you get the display, and any unintended changes get
written to 'junk' and not to 'dataset' -- 'data.entry', of course,
writes back to its argument. This still leaves the inconvenience of
the "modal" operation, but perhaps that's for another day ...

Thanks, and it would be interesting to read commments from others.
Ted.

> On Mon, 12 Jan 2004 Ted.Harding at nessie.mcc.ac.uk wrote:
> 
>> Hi Folks,
>> 
>> The spreadsheet-like layout displayed when 'data.entry' is
>> invoked is very useful simply for legible display of data,
>> quite apart from its intended use for the purpose of entering
>> or editing data.
>> 
>> If one wants to use it _simply_ as a display device, so that
>> one can look around inside a data-set while working on it,
>> then it is not a good idea to have its _editing_ capabilities
>> active: this is dangerous, since an inadvertent keystroke
>> could change the data.
>> 
>> So: is there a way to invoke 'data.entry' in "read-only"
>> mode? Or some other function with equivalent display which
>> can be run "read-only"?
>> 
>> [Bonus question: is there a way to change its cosmetics,
>>  e.g. background colour, font, ... ?]
>> 
>> With thanks,
>> Ted.
> 
> -- 
> 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
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html

--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 167 1972
Date: 12-Jan-04                                       Time: 22:40:06
------------------------------ XFMail ------------------------------




More information about the R-help mailing list