Skip to content
This repository has been archived by the owner on Jul 23, 2023. It is now read-only.

Restructure .R files #18

Closed
maurolepore opened this issue Sep 21, 2018 · 3 comments
Closed

Restructure .R files #18

maurolepore opened this issue Sep 21, 2018 · 3 comments

Comments

@maurolepore
Copy link
Contributor

What are your main functions? There should be one .R file per main function and its helpers.

@ErvanCH
Copy link
Collaborator

ErvanCH commented Oct 4, 2018

What do you mean? Can't be a single R code containing all functions? Isn't the helpers included in the header of the function??

@maurolepore
Copy link
Contributor Author

Can't be a single R code containing all functions?

Yes, you can put all functions in a single .R file. The package will work regardless of your how you organize the functions in files. But the package is easier to understand and maintain if you have a structure like this:

R/main-function-1.R
R/main-function-2.R
R/...

tests/testthat/test-main-function1.R
tests/testthat/test-main-function2.R
tests/testthat/...

@maurolepore
Copy link
Contributor Author

I kind of did this already, by renaming the file to data_preparation.R.

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

No branches or pull requests

2 participants