Output file handling

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Wed Mar 9 13:32:46 UTC 2016


Hi,

On Tue, 8 Mar 2016 11:48:39 +0900
Aaron Batty <abatty at sfc.keio.ac.jp> wrote:
> Thomas: Thanks for picking this up!
> 
> Inline:
> 
> > 1b) What if the user choses not to save the workspace. Will we
> > prompt
> > > about the output, separately (as we do for script files)? Or
> > > better, yet, what would a _unified_ do you want to save
> > > workspace/output/workplace/files dialog look like?
> >
> > could this be made quicker by checkboxes in the dialog? something
> > like
> >
> >  "There are unsaved changes in this session. Please check if you
> > would like to keep them:
> >
> >     [ ] Save workspace
> >     [ ] Save output
> >     [ ] Save script files
> >
> >   [Save chosen changes, discard the rest]   [Cancel]"
> >
> 
> In this case, would all of that go into a handy folder?

See below.

> > 1c) On a more general note: Will we retain the option to save/load
> > > output _independently_ of an R workspace? How exactly?
> >
> >  file -> export -> save current output (HTML)
> >
> 
> The issue with this, though, is that all the graphics are still saved
> in an invisible directory in the user directory. You're not really
> exporting the output at all. You're exporting the textual elements of
> the output. And you're exporting everything you have ever done since
> last time you flushed the output.

You are right. The current export function is not terribly useful. But
the idea may be about right: We will have exactly one "active" output
associated with each workspace. But you can "export" a copy of the
output for archiving and exchange (via an improved export function).

I guess it will then also make a lot of sense to support loading
arbitrary output files. The follow up question is whether (and how) one
can append to a previously exported output. But that may not be the
most pressing problem to worry about.

[...]

> > > 2a) When loading a workspace, doing work, then closing it, without
> > > saving, all data changes will be discarded. Would we also want
> > > discard changes in the output file, then?
> >
> > if they're not saved, i'd vote yes.
> >
> 
> Seconded.

Ok doable. It means we'll have to write to a temporary location, first,
then copy to the "real" location when saving.

> > > 2b) When saving over an existing workspace, will we also
> > > overwrite the associated output (without additional prompt)?
> >
> > that is what i would expect if i checked the "save output" option.
> >
> > how do you propose to store the files? additional separate files?
> > personally,
> > i would prefer having everything in one file, like somehow appended
> > to the .RData file or all files in one zipped archive (except the
> > scripts, although i
> > also like the idea of being able to store a "session-to-go" archive
> > i could send someone, including all currently open script files).
> >
> 
> I was thinking that instead of just spitting out two naked files
> (.RData and .rworkplace), saving should create a directory that
> includes those two, plus rk_out.html, and then maybe an images
> directory for the graphic outputs, just to clean it up a bit. Clean
> and organized, but everything gets its own file, so it's easy to go
> digging in there if one has to (I don't like archives or databases...
> I like to be able to dig.).

Hm. This has obvious merits, but it will make it harder to deal with
existing "plain" .RData files. Right now we can simply load and save
an .RData-file regardless of whether it has been created in RKWard or
elsewhere.

You proposal would mean:
- Loading: Usually you would select an RKWard _directory_ for loading,
  but we'd also have to support load a .RData _file_.
- Saving: When you have loaded an existing .RData file, you cannot just
  save over it, you'd have to create an RKWard directory, instead.

What I have in mind is rather keeping the current approach. I.e.
adding a directory _next to_ the .RData file. This could either be:

xyz.RData
xyz.rkworplace
xyz.rkoutput/index.html
xyz.rkoutput/graph01.png
xyz.rkoutput/...

_or_

xyz.RData
xyz.rkward/.rkworkplace
xyz.rkward/index.html
xyz.rkward/graph01.png
xyz.rkward/...

What do you think?

> > we could save every
> > result to a separate HTML file, so that the current TOC would link
> > to those individual files and not jump between sections in one
> > large file. this would
> > also make it easily possible to discard individual results from the
> > "global"
> > output. maybe the TOC could be replaced by the file browser, by
> > adding a new
> > shortcut button there to the current output directory. or something
> > more fancy.
> >
> 
> That is a really cool idea.

Very interesting idea. There are two areas, where I see (some) problems
with this approach:

- Exchanging / sharing output files. These should be easy to look at
  outside of RKWard, too.
- Export to dead tree format. All in one file is fairly convenient for
  printing, still.

Ideas on how those could be fixed?

Either way, however, this looks like a somewhat separate discussion. I
probably will not take care of both at once.

Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20160309/466d3a58/attachment.sig>


More information about the rkward-devel mailing list