esc1234
esc1234

Reputation: 23

"Rterm could not be found" error trying to run R code using ESS

I'm trying to install Emacs Speaks Statistics using use-package. I have included the following code in my initialisation file.

(use-package ess :ensure t :init (require 'ess-site))

I believe that ESS is installed correctly because when I run the command M-x ess-version it states that I have version 18.10.

However when I tried to run some code in an R file I get the following error in a new buffer

Error (ess): Rterm could not be found on the system. Try running run-ess-r-newest' instead, which searches your system for R.

When I run the run-ess-r-newest command an R session opens up in a new window and I can execute R commands in a console session but when I go back to my original buffer with the aforementioned R file and try to execute a line of code from the script the same error occurs in a new buffer.

Is there any suggestions as to how I can run individual lines of code from an R script and the results for these command appearing in a new buffer displayed in the same frame as the already opened R script akin to how RStudio works.

Any suggestions greatly appreciated!

Upvotes: 0

Views: 537

Answers (1)

esc1234
esc1234

Reputation: 23

I added the file path to the directory that contains my installation of R to the Path system environment variable (I'm using Windows 10) and I'm now able to execute R code without any errors.

Upvotes: 1

Related Questions