How to unmask a function in R, due to name collisions on searchpath

You can detach the package which has masked functions and then reattach it. It will regain precedence in the search path:

detach("package:zoo")
library("zoo")

In the future, if you want to attach a package while preventing it from masking other functions, you can specify its position in the search path with an arbitrary large number:

library("debug", pos = .Machine$integer.max)

Its only masked to you but its not masked to zoo so when a zoo function tries to use index it will still find its own index first.

zoo also has a time.zoo method so if z is a zoo object you can use time(z) in place of index(z).

Finally you can always refer to zoo::index to make sure you get the one in zoo.


Exported symbols are always identifiable with the :: operator:

zoo::index

Hidden functions not declared in the namespace can still be accessed using ::: (triple-colon), and example would be

zoo:::.onLoad

which you can see even though it is not exported.