0

Some time ago I've written function to build R package using "CMD INSTALL" the problem is that I can't do the same with ESS. There is function ess-r-devtools-build but it seems that it don't actually install the package I'm working on it just build tar.gz file.

How can I build and install R package I'm developing in Emacs ESS?

0
0

ESS provides the function ess-r-devtools-load that will run the function devtools::load_all() for you. That will load the current version of your package while you are working on it.

7
  • Do I need to do something extra like first build and then install? Because after calling that function the package is not updated, or maybe I did something wrong.
    – jcubic
    Nov 4 '20 at 13:43
  • load_all assumes your current working directory (getwd) is the top-level directory of an R package you are developing. If you are, it should (re)load all the code in the package into your current session. That makes it available to you in your current session. I'm not sure if it actually installs the package in a way that you'd have access to it from a different session? I only use it when I'm actively working on a particular package, not to permanently install one or more packages into my R library.
    – Tyler
    Nov 4 '20 at 13:56
  • Thanks for explanation unfortunately I'm not able to stop shiny and install package in same session I need to kill R, it seems that my functions are way better the interactive R in ESS, only I can't use browser(), that's why I wanted to try ESS.
    – jcubic
    Nov 4 '20 at 16:46
  • I don't understand what you're trying to do. If Shiny (or any other function) is running, then you can't install a package in the same interactive session. If the Shiny app has an 'exit' feature, you can do that, or C-c C-c from the R session to cancel the function that way. If you can expand your question to explain exactly what you're trying to do, we may be able to find a proper answer for you.
    – Tyler
    Nov 4 '20 at 17:33
  • I know that I need to stopy shiny before install I simply don't want to kill R, see this question on SO How to kill shiny app in ESS without killing R process the problem is this don't work.
    – jcubic
    Nov 5 '20 at 8:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.