Does R have a concept of +=
(plus equals) or ++
(plus plus) as c++/c#/others do?
In R, there is no concept of increment operator but you can make a function that performs the same function as an increment operator.
The Equality Operator == Relational operators, or comparators, are operators which help us see how one R object relates to another. For example, you can check whether two objects are equal (equality) by using a double equals sign == .
increment: IncrementAdds one to given variable and returns this computed variable. Function is used by main function "estimationFunction" and shall not be called or changed by user.
No, it doesn't, see: R Language Definition: Operators
Following @GregaKešpret you can make an infix operator:
`%+=%` = function(e1,e2) eval.parent(substitute(e1 <- e1 + e2)) x = 1 x %+=% 2 ; x
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With