[R] [Fwd: ***HTML***R help]

tyler tyler.smith at mail.mcgill.ca
Wed Sep 3 13:39:30 CEST 2008


Dieter Menne <dieter.menne at menne-biomed.de> writes:
> Brian Lunergan <ff809 <at> ncf.ca> writes:
>> 
>> I am stuck with a problem and I need help
>> ---------------------------
>> R has a defined function sum()
>> 
>> I by chance defined a function with same name and now I m not able to
>> get rid of my sum() fuction. Every time i use sum() my sum function
>> gets called and not the R's built in one...
>
> Almost for sure your .Rdata is read in. Either try another startup 
> directory, or delete .Rdata, or start R with the --vanilla option.
>

To correct this without deleting .Rdata:

mysum <- sum  ## if you still want to use your function
rm(sum)

This will remove your sum, leaving the 'built-in' available. You can also
access the 'built-in' as:

base::sum()

if there was any reason to keep both functions with the same name (unlikely).

Cheers,

Tyler
--



More information about the R-help mailing list