Skip to content

Instantly share code, notes, and snippets.

@benneely
Created February 1, 2016 16:38
Show Gist options
  • Save benneely/5473b6d01a5e7b5ef743 to your computer and use it in GitHub Desktop.
Save benneely/5473b6d01a5e7b5ef743 to your computer and use it in GitHub Desktop.
modify R function in Namespace
unlockBinding("basehaz", as.environment("package:survival"))
assignInNamespace("basehaz", my_basehaz, ns="survival", envir=as.environment("package:survival"))
assign("basehaz", my_basehaz, "package:survival")
lockBinding("basehaz", as.environment("package:survival"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment