[ESS] A few issues and questions from a newbie in R/ESS

Joakim Frögren jo@k|m @end|ng |rom |rogren@@e
Sun Jan 12 04:08:00 CET 2020


I am new to ESS and R, and in fact relatively new to statistics and
Emacs as well, so please be gentle. I am om macOS Catalina 10.15.2 and
Emacs 26.1 (9.0). Here [1] is my init file. I am facing a few problems
at the startup of R and ESS within Emacs that I have struggled with the
last few days since I downloaded R and the ESS package. I installed R
through homebrew and ESS through Melpa. The problems do not occur when I
launch R from the command line, only when I launch R and ESS from within
Emacs. There are two issues related to startup of ESS/R. 

First issue: 

Whenever I start ESS in Emacs, by M-x R, I am asked to answer the
following question:_ R starting project directory? _I do not understand
the necessity of this and especially why ESS doesn't remember and
assumes that whenever I start it I would like to have the same project
directory as the last session. This is something that i am not being
asked when I launch R through the command line. What should I do to not
have to fill in this information for each new session? 

Second issue: 

When I run R from the command line , it uses the correct locale. When I
run an R process in Emacs though, I get the following warning: 

During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C" 
2: Setting LC_COLLATE failed, using "C" 
3: Setting LC_TIME failed, using "C" 
4: Setting LC_MESSAGES failed, using "C" 
5: Setting LC_MONETARY failed, using "C" 

I know that this issue has been discussed a lot online, for example here
[2] and I have managed through one solution to find a temporary
solution. kliron's suggestion there to do this through the command line

/bin/launchctl setenv LANG en_US.UTF-8
/bin/launchctl setenv LC_ALL en_US.UTF-8
/bin/launchctl setenv LC_CTYPE en_US.UTF-8
/bin/launchctl setenv LC_COLLATE en_US.UTF-8
/bin/launchctl setenv LC_MESSAGES en_US.UTF-8
/bin/launchctl setenv LC_TIME en_US.UTF-8
/bin/launchctl setenv LC_MONETARY en_US.UTF-8

However, whenever I reboot, the problem is there again. And I did not
completely understand how to create a .plist to get it to work after
reboot. Would be grateful for help here.

These are the issues related to startup. But I have a few more questions
related to setup in order to get my work process in R going the way I
want. I have been watching this [3] video in order to get a grasp of R.
The guy is using RStudio and I am wondering about if similar things that
he is doing there is possible to do with ESS. These things are: 

Third issue: 

At 16:25 in the video he speaks about Pacman, as a way to manage add-on
R packages. He speaks that the add-ons are necessary to 'load' in order
to function. In what way is this done in ESS? Do I have to 'load'
packages before I used them or are they already available and ready to
use? How does this work? I should say here that I download packages
through Melpa. 

Forth issue: 

At 20:39 in the video, he speaks about ?plot and help functions in R. In
RStudio this help information opens up in a separate window, but in
Emacs this information is shown in the same buffer as used for the
regular tasks. What settings should I put in order to get this help
information presented in a new buffer. I would prefer to have the
following setup.  .R file in an upper buffer, the *R* in the lower
buffer. When opening ?plot, I woul like the lower buffer to split and
the ?plot information being presented on the right hand. 

Fifth issue: 

At 30:40 in the video he speaks about creating a table and in RStudio he
is able to run the following entry (cylinders <- table(mtcars$cyl)) and
then get to see information about name, type, length, size and value of
the table in the top right corner of RStudio. Is this possible to do in
ESS as well in a similar wy? Which command should I use to get to see
this info? 

These were the questions I had at the moment. Would be very grateful for
help! By the way, are there any instruction videos of ESS? Reading and
understanding the manual is not so easy and searching through issues
that have been discussed before on your site was very tricky, since  i
found no way to get an overview of the topics being discussed. Thanks a
lot in advance for your support! 

Best regards, 


[1] https://github.com/jfrogren/.emacs.d
[3] https://www.youtube.com/watch?v=_V8eKsto3Ug&feature=youtu.be
	[[alternative HTML version deleted]]

More information about the ESS-help mailing list