Conflict between here in, uh, here, and here in lubridate?

lubridate

#1

I keep running into problems with conflict between here::here and lubridate::here. lubridate::here has been deprecated since 1.5.6 but is still around. So I have to remember to put library(here) last (or to write here::here … the error message if I don’t is:

Error in here("some_filename") : unused argument ("some_filename")

Other than managing the load order, any advice on how to avoid this (can one load a library but not its deprecated functions?) I’m assuming that lubridate::here will actually go at some point, so that’ll take care of it …


#2

I’m afraid you have a pretty good handle on the situation. I don’t know of any other tricks.


#3

Personally, I almost always use here::here(), even when I don’t have lubridate attached. But, as jenny mentioned, you’ve described the situation as it is.

To make this a little bit easier to deal with, you can always add a snippet in RStudio, if you’re using it.

snippet hh
	here::here("${1}")

Then, you can type hh followed by shift + tab, making the here::here() method slightly less cumbersome.

Here’s a little gif I made for a blog post— it’s for a markdown snippet, but I’m sure you’ll be able to extrapolate for R code!