Skip to content

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

@MeganBeckett

Description

@MeganBeckett

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions