I was wondering if there is an elegant way of calling "self" in a R function. An easy example would be the modification of a date, let's say a is a date in a int format (like when you read from excel).
a = 41557
a = as.Date(a, origin = "1899-12-30")
Then "a" is updated with the proper format. Obviously this example is very simple, but in a context of long variable or more complicated procedure one would like to use something like "self". Does something like this exist in R. Self simply meaning take the variable at the left part of the = sign.
a = 41557
a = as.Date(self, origin = "1899-12-30") # what to use for self.
As a first hint I found out (I think) that some functions are able to call "self" somehow using the "<-" operator for example:
"minc<-" <- function(x, value){x*value}
Gives :
a = 2
a = minc(12)
# a = 24, which is basically : a = self*12
I don't know if such a keyword exist in R, but it would definitely helps in the readability of most of my codes.
As always, thanks for your help !
Romain.