diff --git a/DESCRIPTION b/DESCRIPTION index f37926a..244c708 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: openairmaps Title: Create Maps of Air Pollution Data -Version: 0.9.1.9003 +Version: 0.9.1.9004 Authors@R: c( person("Jack", "Davison", , "jack.davison@ricardo.com", role = c("cre", "aut"), comment = c(ORCID = "0000-0003-2653-6615")), @@ -25,7 +25,6 @@ Imports: leaflet (>= 2.2.0), lifecycle, lubridate, - mgcv, openair (>= 2.13), purrr (>= 1.0.0), rlang, @@ -39,6 +38,7 @@ Suggests: httr, jsonlite, knitr, + mgcv, mirai, prettymapr, rmarkdown, diff --git a/NEWS.md b/NEWS.md index 5b8e83e..e1c4bb0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,8 +6,12 @@ * The progress bar shown when `progress = TRUE` now better reflects the actual time until function completion. +## Refactoring + * `{ggplot2}`, `{ggspatial}`, `{prettymapr}` and `{ggtext}`, the packages which support static mapping, have been moved to `Suggests` from `Imports`. This gives the package a smaller size for users who only use `{openairmaps}` for interactive mapping. On first trying to use a static mapping function, users will be prompted to install these packages. +* `{mgcv}` has been moved to `Suggests` as it is only used in one place (`trajLevelMap(smooth = TRUE)`) + # openairmaps 0.9.1 ## New features diff --git a/R/traj_trajLevelMap.R b/R/traj_trajLevelMap.R index d8fc3d6..90facde 100644 --- a/R/traj_trajLevelMap.R +++ b/R/traj_trajLevelMap.R @@ -446,6 +446,7 @@ trajLevelMapStatic <- #' Smooth grid for trajectories #' @noRd smooth_trajgrid <- function(mydata, z, k = 50, dist = 0.05) { + rlang::check_installed("mgcv") myform <- stats::formula(stringr::str_glue("{z}^0.5 ~ s(xgrid, ygrid, k = {k})"))