简体   繁体   中英

No need to import `!!!` operators into the package DESCRIPTION?

I'm trying to build a package using dplyr . I extensively used !! and !!! operators from rlang .

However, I didn't import them explicitly although the package seems to work nevertheless.

Am I missing something in the environment, or does import(dplyr) somehow cover this?

As a comment above stated, dplyr re-exports tidyeval dependencies from rlang , so if you have dplyr in Imports you don't need to explicitly import rlang . However, it might be worth asking whether you need all of dplyr , or just the tidyeval parts - there's something to be said for keeping dependencies to a minimum. rlang is a very lightweight package dependency-wise, so if you can get away with depending only on it directly it can make your package faster to install and (in theory) less likely to break with an external update.

If you find yourself using a lot of quoting and unquoting operators in package development, you can also check out the usethis package's "tidyverse development helpers" . usethis::use_tidy_eval() "imports a standard set of helpers to facilitate programming with the tidy eval toolkit." It's a quick and easy way to add rlang to Imports, and imports/re-exports and documents the (en)quo(s) , (en)sym(s) , (en)expr(s) , functions, .data pronoun, and := . Then you should have what you need to use tidyeval throughout your package.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM