Dominic
Dominic

Reputation: 135

How can I get R to autoload my .r file after edit it?

Say I have made a function "function.r", after editing the function I have to reload into my global environment via source('function.r'). Is there anyway I can get around having to reloading it into my global environment every time I make an edit?

I'm looking for the same functionality as .m files in Matlab, where when I call the function/script it executes the .m file as opposed calling a preloaded function.

I'm using R studio, if that makes any difference

Upvotes: 3

Views: 944

Answers (1)

alko989
alko989

Reputation: 7908

You can use the Source on save option. Just check the check box above your code.

source on save in RStudio

Upvotes: 6

Related Questions