The assignment operator in R is <-
Although = also works, it is better practice to use <-
Is there a way to write a plugin that would do this replacement on a currently open file without replacing = signs inside parentheses?
so this:
x= 1
y= 2
foo= function(x = 1) {
this =x + 2
return(this)
}
should become (note one space on either side of <-
x <- 1
y <- 2
foo <- function(x = 1) {
this <- x + 2
return(this)
}
Ideas?