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

Peter Dalgaard p.dalgaard at biostat.ku.dk
Tue Jan 13 00:14:24 CET 2004


Prof Brian Ripley <ripley at stats.ox.ac.uk> writes:

> 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.  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.  Read-only non-modal versions might be worth pursuing.

Not sure read-only really factors in there. As soon as object viewers
become non-modal (in the GUI sense, not edit/browse) you have to deal
with what should happen if something else modifies the object. 

What SAS does is to lock a dataset once it is opened in their
Viewtable tool, editable or not, and to much confusion for the naive
user who sees code that worked a minute before suddenly having no
effect whatsoever. In R that would get tricky, even if we wanted to
clone that mode of operation, since we have no way of making
individual objects (recursively) unmodifiable. 

I see two other options: the "scope" model and the "editor" model. The
scope model would try to keep the data viewer/editor in sync with the
object in the workspace at all times. That would likely get even more
tricky. R has copy-on-modify semantics (in principle and sometimes in
practice) so once part of an object changes, you may have to look in
new places for anything that contained it, including possibly the
object itself.

The editor model works like a text editor, where you're dealing with a
copy of what the object looked like when you started the viewer; if
the object changes, you just don't see it and if you subsequently save
the contents, you overwrite whatever got changed. Crude, but hey, it
works for file systems... You can of course make this read-only if you
want, but its not particularly harder to make it editable, is it? In
both cases, the user needs to be aware that it is probably not a good
idea to modify the object that he's viewing.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list