-
-
Save sbalci/f96af73bb9a0073b365b47fb056d66f3 to your computer and use it in GitHub Desktop.
Block assigning to a variable more than once
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`<-` <- function(lhs, rhs, envir = parent.frame()) { | |
assign(as.character(substitute(lhs)), rhs, envir) | |
lockBinding(substitute(lhs), envir) | |
invisible(rhs) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment