0

This a follow-up to How to edit and debug R library sources. I'm wondering if there's an easy way to edit an R library source file and cause the edited file to be loaded by library without reinstalling the code. I'm asking this in the context of a library that I'm developing and am looking for an easy way to incrementally edit and test my code. I know about source and other ways of loading code into an R session, but I want to test scripts that do the usual library thing.

Thanks!

Community
  • 1
  • 1
Nat Goodman
  • 111
  • 1
  • 6

1 Answers1

0

It sounds like you're developing a packages. If that's the case then using the devtools package is probably what you want to do. The load_all() function will systematically reload all of your code so you can make changes and test everything out.

Dason
  • 60,663
  • 9
  • 131
  • 148
  • Thanks for the prompt response. I am using devtools and know about `load_all` – Nat Goodman Dec 19 '16 at 22:49
  • Sorry for the truncated comment above. Thanks for the prompt response. I am using devtools and know about `load_all()`. But I'm testing my package with scripts that use `library` and would like to avoid the need to modify the scripts when the package is installed. – Nat Goodman Dec 19 '16 at 22:52
  • I guess it's still not clear to me exactly what you're doing. – Dason Dec 20 '16 at 12:22