daviddalpiaz / r4sl

:chart_with_upwards_trend: Machine Learning from the perspective of a Statistician using R
https://daviddalpiaz.github.io/r4sl/
72 stars 62 forks source link

Cache code chunks #12

Open coatless opened 6 years ago

coatless commented 6 years ago

As you continue to add on code that is computationally intensive, you will need to start caching the code chunk results. This in turn means you should start labeling your code chunks (otherwise, they're treated like cattle). Otherwise, we'll have to move you to pushing a rendered product via a netlify setup.

daviddalpiaz commented 6 years ago

Yeah, no kidding, build times are getting bad. I'm actually temped to take the netlify approach since I've really enjoyed using it, but I know I should just bite the bullet and label everything and think more about caching. I think dependson solves most of my troubles. There isn't a more automatic way right? And I need to be careful to only depend on other cached chunks?

Question, is there a way to start form a fresh environment for each chapter when rendering a bookdown book? (That isn't the default is it?) I don't think it matters, but when thinking about caching, I want to think in terms of chapters, and never have a chapter depend on a previous chapter.

daviddalpiaz commented 6 years ago

Need to fix the temporary fix of using autodep. This will finally require naming all chunks. (Need to think of a good naming scheme.)

coatless commented 6 years ago

How about chap-sec-content?

daviddalpiaz commented 6 years ago

I'm not sure what that means?

coatless commented 6 years ago

@daviddalpiaz proposed naming scheme for you...

daviddalpiaz commented 5 years ago

Note to self to use my solution to this problem from the appliedstats book.

daviddalpiaz commented 5 years ago

(Based on most recent build time, some caching is certainly happening, but still want to investigate this further.)