I'm building my first R package. While developing the package, I'd have my ~30 functions open and loaded. Before loading them, I would load all required libraries:
library(dplyr)
library<package2>
...
library<package n>
In my DESCRIPTION file, I have all the packages under Imports
:
Imports:
dplyr,
<package2>
...
<package n>
Great, but now when I load my own library and begin running the 1st function, I get :
Error in mydf[c(11:16), c(21:22)] %>% stack() %>% pull(values) %>% drop_outliers(., :
could not find function "%>%"
Am I really expected to change every instance of %>%
to dplyr::%>%
? This occurs hundreds of times throughout my functions. What about the other functions used hundreds of times?
I could use the zzz.R
file to load the libraries , but from cursory reading online it seems this is a no-no. What do I do?