I'm developing a package in RStudio with usethis, trying to make use of best practices. Previously, I had run usethis::use_tidy_eval(). Now, I'm using data.table, and set this up by running usethis::use_data_table(). I get a warning,
Warning message:
replacing previous import ‘data.table:::=’ by ‘rlang:::=’ when loading ‘breakdown’
because the NAMESPACE contains the the two lines:
importFrom(rlang,":=")
importFrom(data.table,":=")
It turns out I no longer need usethis::use_tidy_eval(), so I'd like to revert it and in doing so get rid of the warning.
How can I undo whatever usethis helper functions do? Must I edit the NAMESPACE myself? How do I know what else was modified by usethis::use_tidy_eval()? What about undoing usethis::use_pipe()?
Unless you made a Git commit before and after running that code, there's probably not an extremely easy way. The two options I'd consider would be:
Read the source code of the function. This can require some hopping around to find definitions of helper functions, but
use_tidy_evallooks like it:roxygentoSuggestsinDESCRIPTIONrlangtoImportsinDESCRIPTIONtidy-eval.Rdocument()which is what actually updates theNAMESPACE. You can find the lines added by looking for the importFrom roxygen tags in the template file.To undo this, you should just be able to delete all of the above. However, you need to be a bit careful - e.g. if you import functions from
rlangoutside oftidy-eval.R, removing it fromDESCRIPTIONmight prevent installation. Hopefully any such issues would be revealed bydevtools::check()if they do happen.The other option would be to get an older version of your package, run use_tidy_eval() and document() and then compare the changes. That will be more comprehensive and might catch things I missed above, but the same caveats about not being able to necessarily just reverse everything still apply.
Same strategy for
use_pipe().Sidenote: there are probably ways to adequately qualify different uses of
:=so that both can coexist in your package, in case that would be preferable.