Redefining a function in an R package
问题 I tried to modify and redefine a function (xcmsRaw) in R package xcms by first defining a function my.xcmsRaw <- function(filename, profstep = 1, profmethod = "bin", profparam = list(mzcorrf=1), # PATCH - mzcorrf is the m/z correction factor, e.g. 0.99888 for long-chain hydrocarbons includeMSn = FALSE, mslevel=NULL, scanrange=NULL) { ... } and then typing unlockBinding("xcmsRaw", as.environment("package:xcms")) assign("xcmsRaw", my.xcmsRaw, as.environment("package:xcms")) lockBinding("xcmsRaw