[ESS] Emacs can find R-devel and R-newest, but not R-4.0.x

2020-11-25 Thread Marius Hofert via ESS-help
Hi,

I used to be able to start a specific R version with M-x R-... but it
doesn't work anymore. On M-x R- I see:
R-devel
R-initialize-on-start
R-mode
R-newest
R-transcript-mode
... but no R-4.0.x. I have R-4.0.0, R-4.0.2, R-4.0.3 and R-devel
installed and M-x R-devel and M-x R-newest correctly find and start
R-devel and R-4.0.3, respectively. The other two R versions are set up
exactly in the same way, which is why it's so confusing that they are
not found. Also, in an Emacs shell (M-x shell), R-4.0. completes
to all R versions and I can also start every single one of them.

Any ideas what to try?

This is on macOS 10.15.7 with GNU Emacs 26.3 and ESS version 18.10.2
[Released git: d4cd65da6dbf].

Thanks & cheers,
Marius

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[ESS] error in process sentinel: Not enough arguments for format string

2019-12-11 Thread Marius Hofert via ESS-help
Hi,

As I reported on https://github.com/emacs-ess/ESS/issues/883 (last
post), I'm (still) affected by the randomly appearing error "error in
process sentinel: Not enough arguments for format string" and related
'freezing' of Emacs (which is especially popular when teaching in
front of 300 students :-) ). My workaround so far was to use M-x
flymake-mode to disable flymake which solved the problem.

Before disabling flymake mode completely (not sure if (setq
flymake-start-on-flymake-mode nil) would be correct...), I thought
I'll ask to a) express that the problem still exists and b) perhaps
learn how to properly tell ESS to avoid flymake mode or to deal with
the problem otherwise. After browsing a bit, I found ess-r-flymake on
https://emacs.stackexchange.com/questions/46556/error-in-process-sentinel-whenever-using-in-an-ess-r-buffer?noredirect=1=1
but I'm not sure if that's the write place for modifications for
disabling flymake mode.

I'm using ESS 18.10.2 [Released git: d4cd65da6dbf] and GNU Emacs 26.3
on macOS (the problem appeared at least in 10.14 and 10.5). I don't
have a reproducible example. I did get the feeling though that chances
of triggering the error are slightly higher if I'm "fast", for
example, quickly switching to an R buffer and trying to make
modifications or quickly navigating through many lines of source code
and then modifying a line. It appears maybe 2 to 3 times a day when
I'm programming.

Thanks & cheers,
Marius

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[ESS] in 18.10.3: Roxygen header is put at the wrong place if point is at the beginning of the line

2019-06-08 Thread Marius Hofert via ESS-help
Hi,

I realized that in the current snapshot version of ESS (18.10.3), C-c
C-o C-o (for Roxygen function headers) does not work as expected
anymore (on macOS 10.14.5) in the following case (and others):

fun1 <- function(x) x

fun2 <- function(x) x

If the point is right before the "f" (so column 0) of "fun2", then C-c
C-o C-o puts the Roxygen header above fun1, not fun2. If the point is
anywhere else on that line, the header is put in the right place, so
right above fun2.

I hope you can reproduce this (I already switched back to the stable
18.10.2 for that reason).

Thanks & cheers,
Marius

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[ESS] Assignment operator "<-" not bound to "_" anymore (or any other default it seems).

2019-03-26 Thread Marius Hofert via ESS-help
Hi,

In 18.10.3snapshot (GNU Emacs 26.1, macOS 10.14.4) "_" is not the
assignment operator "<-" anymore (it still was in 18.10.2). This step,
especially the fact that there is no new default to obtain "<-" (or is
there?) might scare away users... I'm also posting this so that others
can find it as it took me quite some time to figure out that this was
somewhat announced: search for "<-" on
http://ess.r-project.org/Manual/readme.html -- referring to version
19.04 (unreleased; why so many versions ahead?).

Is there a new recommended way to get "<-"? I now use...

(define-key ess-r-mode-map (kbd "M--") #'ess-insert-assign)
(define-key inferior-ess-r-mode-map (kbd "M--") #'ess-insert-assign)

... to bind M-- to "<-",  as RStudio uses. This makes it easier to
switch to RStudio when teaching from that. Don't get me wrong, I'm a
die-hard Emacs + ESS user since about 2010 when Martin Maechler
introduced ESS to me, but in our undergrad courses with class sizes of
up to 1000 students, we are kind of required to teach from RStudio as
this is what students nowadays use.

Not having a default for "<-" seems weird to me and not everyone likes
to make adjustments to .emacs just to get basic functionality (... and
thus probably switches to RStudio...).

Cheers,
Marius





-- 
Marius Hofert, Dr. rer. nat.
Assistant Professor
Department of Statistics and Actuarial Science
Faculty of Mathematics
University of Waterloo
200 University Avenue West, Waterloo, ON, N2L 3G1
+1-519-888-4567, ext. 31394 (office M3 4207)
http://math.uwaterloo.ca/~mhofert

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Indent for R's 'switch'

2018-06-22 Thread Marius Hofert via ESS-help
Hi Alex,

thanks for your quick reply. You are right, I used "(setq
ess-default-style 'C++)", so it's a problem of the C++ style.
Thanks for pointing this out.

I can confirm that the problem does not exist in the default style
(although all cases are indented then, which is a bit of a waste of
space since often one has constructions like "my_variable_value <-
switch(...)" and so everything is indented quite a bit; would still
find it elegant to have the cases aligned with 'switch')

Cheers,
Marius

On Fri, Jun 22, 2018 at 10:54 AM Alex Branham  wrote:
>
>
> On Fri 22 Jun 2018 at 09:50, Marius Hofert via ESS-help 
>  wrote:
>
> > Hi,
> >
> > ESS (version 16.10-1 but also earlier) gives the following indentation
> > for switch statements in r:
> >
> > f <- function(method = c("foo", "bar"))
> > {
> > switch(match.arg(method),
> >"foo" = { # (*)
> > cat("Will use 'method' = \"foo\".\n")
> > },
> > "bar" = {
> > cat("Will use 'method' = \"bar\".\n")
> > },
> > stop("Wrong 'method'"))
> > }
> >
> > Line (*) is not ideal. Looking over the various cases (in longer
> > switch statements) along column 4 (containing the "s" of "switch()"),
> > one can easily overlook the case "foo". The following would be great
> > to have:
> >
> > f <- function(method = c("foo", "bar"))
> > {
> > switch(match.arg(method),
> > "foo" = {
> > cat("Will use 'method' = \"foo\".\n")
> > },
> > "bar" = {
> > cat("Will use 'method' = \"bar\".\n")
> > },
> > stop("Wrong 'method'"))
> > }
> >
> > Is that possible?
>
> This is what I get when using the default style, FWIW.

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[ESS] Indent for R's 'switch'

2018-06-22 Thread Marius Hofert via ESS-help
Hi,

ESS (version 16.10-1 but also earlier) gives the following indentation
for switch statements in r:

f <- function(method = c("foo", "bar"))
{
switch(match.arg(method),
   "foo" = { # (*)
cat("Will use 'method' = \"foo\".\n")
},
"bar" = {
cat("Will use 'method' = \"bar\".\n")
},
stop("Wrong 'method'"))
}

Line (*) is not ideal. Looking over the various cases (in longer
switch statements) along column 4 (containing the "s" of "switch()"),
one can easily overlook the case "foo". The following would be great
to have:

f <- function(method = c("foo", "bar"))
{
switch(match.arg(method),
"foo" = {
cat("Will use 'method' = \"foo\".\n")
},
"bar" = {
cat("Will use 'method' = \"bar\".\n")
},
stop("Wrong 'method'"))
}

Is that possible?

Cheers,
Marius

PS: There is a slight chance I already asked for this long time ago...
not sure anymore, though. Would be good to have.

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[ESS] Strange behaviour of ess-eval-buffer-from-beg-to-here?

2017-08-09 Thread Marius Hofert
Hi,

Here is some R code, that, when put in an R script (.R), shows some
strange behaviour (see sessionInfo() etc. below) under ess-version:
16.10-1.

(foo <- matrix(rnorm(100), ncol = 5))
L <- matrix(c(2, 0, 0,
  6, 1, 0,
 -8, 5, 3), ncol = 3, byrow = TRUE)
Sigma <- L %*% t(L)
P <- cov2cor(Sigma)
d <- ncol(P)
n <- 1e4
set.seed(271)
Z <- matrix(rnorm(n * d), ncol = d)
X <- t(L %*% t(Z))
(T <- cor(X, method = "kendall"))

If I put the curser in line 2 and execute C-c 
(ess-eval-buffer-from-beg-to-here), the matrix 'foo' is printed.
However, if I put the cursor in the line after the last one and
execute C-c , I still see the matrix 'foo' but the correlation
matrix 'T' is not printed. (If I step through the code line-by-line, T
is of course printed). Is this a bug?

I could replicate a similar behaviour (T not printed) as above with
C-c C-c (ess-eval-region-or-function-or-paragraph-and-step). Needless
to say, this is frustrating if you want to show several
outputs/variables at once in a script (for example, when teaching). I
can't remember this ever happening before. Any ideas?

I have ess-version: 16.10-1 [git:
58c130a1bc13c8933bde229424d628ec2b6a6a97] (loaded from
/usr/local/ESS/)

sessionInfo() is:

R version 3.4.1 (2017-06-30)
Platform: x86_64-apple-darwin16.6.0 (64-bit)
Running under: macOS Sierra 10.12.6

Matrix products: default
BLAS: /usr/local/R/R-3.4.1_build/lib/libRblas.dylib
LAPACK: /usr/local/R/R-3.4.1_build/lib/libRlapack.dylib

locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

loaded via a namespace (and not attached):
 [1] copula_0.999-18   compiler_3.4.1Matrix_1.2-10 ADGofTest_0.3
 [5] tools_3.4.1   pspline_1.0-18gsl_1.9-10.3  mvtnorm_1.0-6
 [9] grid_3.4.1pcaPP_1.9-61  numDeriv_2016.8-1 stats4_3.4.1
[13] lattice_0.20-35   stabledist_0.7-1

Thanks & cheers,
Marius

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help