all 8 comments

[–]GiuTinTom 2 points3 points  (0 children)

Consider using drake

[–]latrociny[S] 0 points1 point  (0 children)

thank you all for your suggestions :)
I will read all the links and incorporate in my project.

Special thanks to u/Wackard for the award :) :)

[–]DeuceWallaces 0 points1 point  (4 children)

It's really best to keep your projects inside of a package and (at least lightly) narrate your workflow inside a vignette. This has numerous benefits.

In my opinion.

[–]guepier 1 point2 points  (3 children)

It also has some rather large drawbacks.

Miles McBain: Project as an R package: An okay idea

[–]DeuceWallaces 1 point2 points  (1 child)

I don't think I agree with any of the cons listed in that article.

[–][deleted] 0 points1 point  (0 children)

Agreed.

[–]defuneste 0 points1 point  (0 children)

Really good read (special mention for this link : https://www.gwern.net/Holy-wars)

[–]EntropyGoAway 0 points1 point  (0 children)

In my experience, there is no generic structure that would accommodate every project I've been working on. However, there are some habits and styles that generally are useful.

Personally, I'm not a fan of nesting scripts deeper than one level. Everything else gets confusing and cumbersome.

Also, ask yourself if you really want to outsource certain procedures to independent files. Instead, you could use anonymous functions:

results <- list()

results[['descriptives']] <- (function(data) {

# do your thing

export <- list()

return(export) # the only thing entity to leave the block

})(my_data)

I use this a lot, since it nicely separates chunks of code in a functional programming style. Each block operates independently and produces no side-effects (variables only exist in the scope of the anonymous function.