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

Marius Hofert marius.hofert at uwaterloo.ca
Wed Aug 9 19:14:23 CEST 2017


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

(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
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 <C-up>
(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 <C-up>, 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

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

[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.1    Matrix_1.2-10     ADGofTest_0.3
 [5] tools_3.4.1       pspline_1.0-18    gsl_1.9-10.3      mvtnorm_1.0-6
 [9] grid_3.4.1        pcaPP_1.9-61      numDeriv_2016.8-1 stats4_3.4.1
[13] lattice_0.20-35   stabledist_0.7-1

Thanks & cheers,

More information about the ESS-help mailing list