[ESS] ESS R code evaluation in package

Cyrus Harmon cyru@ @ending from bobobe@ch@com
Fri Nov 9 18:38:25 CET 2018

On 11/8/18 2:32 PM, Vitalie Spinu via ESS-help wrote:
> Namespaced evaluation should work for R code as described above. If not, it's a
> bug.

These probably aren't bugs but now that I've gotten things to a somewhat 
more manageable state my next problem is getting things working with 
polymode. When I'm editing an Rmd file and have ```{r ...} blocks 
polymode does the right thing and allows me and C-c C-r blocks of code 
and mostly the right thing happens. The problem is that I don't see the 
[pkg:...] line on the emacs status bar and my code seems to be evaluated 
in an undexpected environment. I'm not sure if this is a polymode or an 
ESS problem but is there someway to specify the pkg in which ESS should 
be evaluating code? Presumably when editing R code it's finding the 
nearest NAMESPACE file and using that but there could be some other 
mechanism. Should I be asking in some polymode forum or here?

I'm missing lisp's (in-package ...) forms that make it relatively clear 
in which context code is supposed to be evaluated. The NAMESPACE thing 
is a rather blunt instrument.



More information about the ESS-help mailing list