Counters | R Documentation |
Counters
Signed increment
Non-negative increment
counter %+-% increment counter %++% increment
counter |
If |
increment |
An integer value \neq 0 to add to |
## Not run: # Signed increment # Notice the difference between passing an object and a value for counter # Value (10 %+-% -5) (10 %+-% -5) # Object i <- 10 (i %+-% -5) (i %+-% -5) # This means we can use the infix in a while ... statement # WARNING: As is the case for any while ... statement, be careful not to create an infinite loop! i <- 10 while(i > -5){ i %+-% -5 print(i) } # Non-negative increment # Notice the difference between passing an object and a value for counter # Value (0 %++% 5) (0 %++% 5) # Object i <- 0 (i %++% 5) (i %++% 5) # This means we can use the infix in a while ... statement # WARNING: As is the case for any while ... statement, be careful not to create an infinite loop! i <- 0 while(i < 20){ i %++% 5 print(i) } ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.