I accidentally rewrote a function from the base package R, how can I return to the default?

I accidentally rewritten the which() function from the base package to R with my own code. I need the default source function which() really bad, but I made a mistake in saving my workspace (R Console) with a new (my own) definition of which() function (which ironically uses the original which() function in it), so now which does not work at all. How do I return the default value of which() back? Is there a way to find the source code for which( ) function?

+4
source share
1 answer

Try to work ...

 which <- base:::which 

which is explicit, or you can use rm( which ) [ thanks @mnel ]

+7
source

Source: https://habr.com/ru/post/1497206/


All Articles