I wonder what the best way to handle masking conflicts the right way if the conflicting packages are not my own packages. Consider the following example. I work a lot with time series
and typically function names like quarter, year etc. are used quite often. So if I load tis
and data.table
the functionality of R clearly depends on the sequence the packages are loaded.
library(tis)
library(data.table)
# this masks: between, month, quarter, year
library(TSfame) # loads TSdbi
con <- TSconnect("somefame.db")
# the following fails when data.table was loaded after tis
ts1 <- TSget("somekeyInYourDB",con)
and TSget from the TSdbi
package does not work anymore. Do I need to fork the package and implement some ::
syntax? The example might be specific, but the question is pretty general. What would more experienced users do?
EDIT: Probably I need to state this more clearly. The problem is that I don't have a chance to call the function explicitly because TSget is calling the function that should be called explicitly and assumes that there's only tis.
EDIT2, adding the call stack as requested by Richie Cotton:
Tracing year(actualStart) on entry
[[1]]
TSget("kofbauindikator_total", con)
[[2]]
TSget("kofbauindikator_total", con)
[[3]]
.local(serIDs, con, ...)
[[4]]
getfame(serIDs[i], dbname[i], save = FALSE, envir = parent.frame(),
start = NULL, end = NULL, getDoc = FALSE)
[[5]]
year(actualStart)
[[6]]
.doTrace((function ()
print(sys.calls()))(), "on entry")
[[7]]
eval.parent(exprObj)
[[8]]
eval(expr, p)
[[9]]
eval(expr, envir, enclos)
[[10]]
(function ()
print(sys.calls()))()
Error in as.POSIXlt.default(x) :
do not know how to convert 'x' to class “POSIXlt”