EvaMaeRey / flipbookr

Presenting code step-by-step and side-by-side with its output
https://evamaerey.github.io/flipbookr/
Other
198 stars 20 forks source link

Undeclared dependency: `embed_flipbook` doesn't run without tidyverse installed #46

Open camille-s opened 3 years ago

camille-s commented 3 years ago

Hi, I'm excited to try out this package! I'm getting an error trying to run or knit the embedded flipbooks template due to the tidyverse package not being installed, which isn't declared as a flipbookr dependency. I'm currently working on a package myself, so I'm keeping my library pretty limited. The tidyverse crew recommends against using the tidyverse package itself as a package dependency, and says developers should instead import individual packages as needed.

I've traced the error back to embed_flipbook calling write_instant_flipbook_source, which writes library(tidyverse) into an Rmd document and then tries to render it. For now, I'll just use the source of embed_flipbook as an example to build my own embedded flipbook, but wanted to bring it to your attention. As far as I can tell, the line loading tidyverse is more an example than something that's necessary for the rendering anyway.

If it's helpful, I could propose a pull request based on whatever workaround I come up with.

Thanks!

EvaMaeRey commented 3 years ago

This is an excellent suggestion! You are right that tidyverse is not needed to create an example. I think ggplot is not a dependency, but dplyr is. The example could be really simple - dplyr pipeline.

embed_flipbook is not an exported function yet; thank you for the suggestions for making it cleaner!