You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There may be numerous places throughout the package where functions from dependent packages are not explicilty referenced with their dependent package. This results in limited user-ability to call functions ( Rnssp::<function>(...)) unless the entire package is loaded first (i.e. library(Rnssp)), which is sometimes not desirable.
Here is an example using the Rnssp::change_dates() function.
Note that in this case, the package does not correctly handle its internal usage of the magrittr pipe, requiring the user to load that package before calling the Rnssp function. Note, however, that doing so reveals another example of insufficient handling of internal dependencies, this time with the stringr package.
df<-data.frame(
date= seq(as.Date("2014-01-05"), as.Date("2022-02-05"), "weeks"),
count= rpois(length(seq(as.Date("2014-01-05"), as.Date("2022-02-05"), "weeks")), 25)
)
df_farr_original<-Rnssp::alert_farrington(df, t=date, y=count)
Errorindf %>% pull(!!enquo(t)) :couldnotfindfunction"%>%"# fix by loading magrittr, but next error is because of dependency on `dplyr`
library(magrittr)
df_farr_original<-Rnssp::alert_farrington(df, t=date, y=count)
Errorin pull(., !!enquo(t)) :couldnotfindfunction"pull"# fix by loading `dplyr`, but next error is because of dependency on `tidyr`
library(dplyr)
df_farr_original<-Rnssp::alert_farrington(df, t=date, y=count)
Errorin unnest(., c(data_split, anomalies)) :couldnotfindfunction"unnest"# fix by loading `tidyr`, but next error is because of dependency on `purrr`
library(tidyr)
df_farr_original<-Rnssp::alert_farrington(df, t=date, y=count)
Errorin`mutate()`:
ℹ Inargument:`anomalies = map(...)`.Causedbyerrorin`map()`:!couldnotfindfunction"map"# fix by loading `purrr`
library(purrr)
df_farr_original<-Rnssp::alert_farrington(df, t=date, y=count)
Improving the internal handling of functions and operators from dependent packages could result in more seamless experience for users.
The text was updated successfully, but these errors were encountered:
Thank you @lmullany for your contributions. We will make sure this issue is fully addressed in the upcoming version of the package. So please, stay tuned for the updates.
There may be numerous places throughout the package where functions from dependent packages are not explicilty referenced with their dependent package. This results in limited user-ability to call functions (
Rnssp::<function>(...)
) unless the entire package is loaded first (i.e.library(Rnssp)
), which is sometimes not desirable.Here is an example using the
Rnssp::change_dates()
function.Note that in this case, the package does not correctly handle its internal usage of the magrittr pipe, requiring the user to load that package before calling the Rnssp function. Note, however, that doing so reveals another example of insufficient handling of internal dependencies, this time with the
stringr
package.Again, user is required to load the required package(
stringr
), and only then can the function be called without error:This is not the only example where internal handling of dependencies could be improved. For example:
Finally, here is a more extended example where the user must load multiple packages. Taking the example from https://cdcgov.github.io/Rnssp/reference/alert_farrington.html:
Improving the internal handling of functions and operators from dependent packages could result in more seamless experience for users.
The text was updated successfully, but these errors were encountered: