NCC-CNC / wtw-data-prep

Scripts to prepare data for Where To Work tool
0 stars 0 forks source link

prep wtw data without the need of WTW package (05 script) #37

Open DanWismer opened 2 months ago

DanWismer commented 2 months ago

having users install the full wheretowork package is very messy. There is to much stuff in there that is not needed for prep.

DanWismer commented 2 months ago

@jeffreyhanson could the .Rbuildignore be used to ignore parts of the package? For example, we really only need access to the parts for prepping the data. All the shiny and rcbc stuff for example doesn't need to come with for a local wheretowork install because users won't be running the web app locally.

If they want to run the app locally, we will set them up running it in a docker container.

DanWismer commented 2 months ago

I believe all we need is:

jeffreyhanson commented 2 months ago

Yeah, I understand why it'd be a pain for users to install the full WTW package when they just want to prepare the data. I don't think rbuildignore is the best way to do this, because the shiny app is run as an R package (due to the golem framework) from within the docker container -- so excluding files from the "package" will also impact the shiny app. I think there might be a couple of options here:

  1. You make all the shiny and optimization functionality and dependencies available as optional dependencies. This would involve (1) moving dependencies from Imports to Suggests in the Description and (2) updating functions to contain additonal checks that their dependencies are available (e.g., something like assertthat::assert_that(requireNamespace("shiny"), msg = "shiny package not available"). This way users won't automatically download all the packages for the all the functionality of the package.

  2. You could split WTW into 2 packages: one for data prep and one for the shiny app (sort of like WTD and the template maker app).

How does that sound?