[R] modify function in a package

C Lin baccts at hotmail.com
Thu Sep 25 20:21:38 CEST 2014


Dear R users, 
There is a package called NanoStringNorm with a function called NanoStringNorm.
What I want to do is to change the NanoStringNorm function from the package with my own copy that is written in my.nanostringnorm.R. 
But if I do the following: 

source('my.nanostringnorm.R")
unlockBinding("NanoStringNorm", as.environment("package:NanoStringNorm")) ; 
assign("NanoStringNorm", NanoStringNorm, "package:NanoStringNorm") ; 

Although, it now correctly called my NanoStringNorm, it doesn't recognize a function called inside my NanoStringNorm that called another functions in the NanoStringNorm package. 
So, I have to change all such functionswith NanoStringNorm:::function.name. 
How should I replace the NanoStringNorm function but still able to call other function in the package? 
I still have package NanoStringNorm in my search path but somehow it can't find the other function. 

TIA, 
Lin 		 	   		  


More information about the R-help mailing list