Reputation: 151
This is really not so important but it would save some typing and make things look nicer occasionally. Is there anything like the C++ ++
operator in R? In other words is there an shorthand for i<-i+1
? I don't really want to use it in loops which one should avoid in R anyway but I have a code with a list of matrices and want to increase or decrease numbers by one each time something happens (it is a simulation of a process), so I have to type something like listname[[i]][j,k] <- listname[[i]][j,k] + 1
. Thanks.
Upvotes: 2
Views: 971