Domanda

At the moment when I start up an ESS buffer (with M-x R) I get that the output of my commands only occupies about 60ish characters in column width (particularly when displaying data frames with long column names). I was wondering if there was a simple way to adjust this limit.

È stato utile?

Soluzione

Ben Bolker's comment is correct: options("width"=200) is something I use on a machine with wide monitors.

I am not aware of an environment variable that reports this back to ESS to auto-adjust. It would be a useful addition.

And just like options("width"), a few things are generally useful at startup, so I currently have this on another machine

edd@max:~$ cat .Rprofile
## Example of .Rprofile
options(width=155, digits=6, digits.secs=6)
## AER page vii
options(prompt="R> ")
## Default repo
local({r <- getOption("repos")
       r["CRAN"] <- "http://cran.r-project.org"
       options(repos=r)
})

Altri suggerimenti

The following sets R's option "width" to the width of your buffer right on R's startup:

(add-hook 'ess-R-post-run-hook 'ess-execute-screen-options)

Note that this works with the newest ESS 12.09, for older versions use ess-post-run-hook.

Also in the latest ESS you can execute this with C-c h w RET, or alternatively bind it to a handy key:

(define-key inferior-ess-mode-map "\C-cw" 'ess-execute-screen-options)

It could be set to execute each time the window changes it's size, but my guess is that it would require quite some lisping.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top