Best place to create helper functions?

Everything related to the development of modules in jamovi
Post Reply
DStuder
Posts: 9
Joined: Wed Jun 07, 2023 8:07 am

Best place to create helper functions?

Post by DStuder »

Hi there!

For the module I'm developing I find myself constantly copying code from one place to another, both within the same analysis and and also between different analyses (i.e. data cleansing, which is pretty much the same process for all of my analyses). So I thought it would be easier just specifying a helper function somewhere and then call it. I know it is possible within one analysis to define a function and reuse it, but is there a way to define a function in a place where all of my analyses can access these functions?
If not, could I create an R-package with these helper-functions, publish it on GitHub and call them from there?

Thanks for your help :relaxed:

Best,
Dan
User avatar
jonathon
Posts: 2627
Joined: Fri Jan 27, 2017 10:04 am

Re: Best place to create helper functions?

Post by jonathon »

hi dan,

just put your helper functions in a separate .R file, then you can call them anywhere.

cheers

jonathon
Post Reply