[ESS] Viewing data frames

Sven Hartenstein lists at svenhartenstein.de
Mon Feb 28 20:24:45 CET 2011


Hi Stephen and all,

thank you for your answer, Stephen! Very helpful for me!

> > Is there anything else that would make it easy to quickly view
> > data frames? Quickly means: I do not want to write.table() and
> > then import in some spreadsheed software.
> It doesn't really solve your problem, but as a general reminder, you
> can use ess-r-dired to view your objects. (Described in the doc.)

I did not know about this function! It's great! (And for the records,
it's "ess-rdired" without the second hyphen.)

Now, I looked at ess-rdired and ess-rdired-View and did my own
version:

(defun my-rdired-View (objname)
  "View an object in its own buffer.
Similar to `ess-rdired-View', but my taste."
  (interactive "sEnter object name: ")
  (ess-command "tmpwidth <- options('width')[[1]]\n")
  (ess-command "options(width=9999)\n")
  (ess-execute objname nil (concat "R view " objname ))
  (ess-command "options(width=tmpwidth)\n")
  (switch-to-buffer (concat "*R view " objname "*"))
  (toggle-truncate-lines 1))

It temporarily sets options(width=9999) and in the R view buffer
calls toggle-truncate-lines. This makes the lines be long so that you
need to scroll horizontally, but have no breaks. This seems to
perfectly meet my request.

One little piece is missing: is there a way to have the new buffer
created by ess-execute in the upper window if I have two windows
(regardless of where the point is)?

> csv-mode.el --- major mode for editing comma-separated value files

Also was unknown to me. I might try it.

Sven



More information about the ESS-help mailing list