OCHA-DAP / hdx-signals

HDX Signals
https://un-ocha-centre-for-humanitarian.gitbook.io/hdx-signals/
GNU General Public License v3.0
6 stars 0 forks source link

Move `logger` setup to `.Rprofile` #224

Closed hannahker closed 3 months ago

hannahker commented 3 months ago

Addresses #133

hannahker commented 3 months ago

Hey @caldwellst do you have any idea what might be going on with the renv setup in these actions? I'm having a hard time debugging here.

caldwellst commented 3 months ago

Aha yes, I see! The errors are coming about because .Rprofile is loaded at the beginning of any R session. However, in this case, it's loading at the beginning of an R session where we haven't restored our installed libraries yet with {renv} (hence why {box} isn't available.

I think best would be to wrap the call to {box} to check if it's been installed, then run the relevant code block. We can assume if {box} installed then also {logger} and other necessary packages are too, I think.

Something like:

if ("box" %in% installed.packages()) {
  ...
}