Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions within one R file or separate (and associated tests) #1

Open
MeganBeckett opened this issue Jul 9, 2019 · 0 comments
Open

Comments

@MeganBeckett
Copy link

Hi!

A question (and perhaps something to mention or clarify in the tutorial?), is in R package development, is it standard/better practice to have one R file per function?

I know that it's possible to put more than one function within a file, and I do this for related functions. But, what is bets practice?

And, if you do have multiple functions within one file, how does this work with the usethis workflow (ie. to add a new function to an existing file, rather than creating a new one?).

Then, in terms of Jim's section on writing unit tests, if you do have more than one function with an R file, I'm assuming you would also have all the tests for the various functions within one file? Or, is this not suggested?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant