Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accidentally rewrote a function from R base package, how to get back to default?

Tags:

function

r

base

I have accidentally rewrote which() function from base package in R by my own code. I need the original default which() function really badly but made a mistake of saving my workspace ( R Console) with the new (my own) definition of which() function ( that ironically uses the original which() function in it) so now which doesn't work at all.. How do I get the default which() back? Is there a way to find the source code for which() function?

like image 257
zima Avatar asked Aug 15 '13 10:08

zima


1 Answers

Try should work...

which <- base:::which

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

like image 170
Simon O'Hanlon Avatar answered Sep 23 '22 12:09

Simon O'Hanlon