Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

r

rstudio

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

like image 522
Dominic Avatar asked Nov 20 '25 21:11

Dominic


1 Answers

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

source on save in RStudio

like image 178
alko989 Avatar answered Nov 22 '25 11:11

alko989



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!