R: Increment and Decrement

inc-dec {Hmisc} | R Documentation

## Increment and Decrement

### Description

`inc<-` increments `x` by `value`. Equivelent to `x <- x + value`.

`dec<-` decrements `x` by the `value`. Equivelent to `x <- x - value`.

### Usage

    inc(x) <- value

    dec(x) <- value

### Arguments

`x` | object to be incremented or decremented
`value` | value by which `x` will be modified

### Author(s)

Charles Dupont

### Examples

    x <- 1:5
    inc(x) <- 5
    x            # c(6,7,8,9,10)

    dec(x) <- 3
    x            # c(3,4,5,6,7)

[Package Hmisc version 4.0-3 Index]