R: Add indicator values as columns to a data frame

add_indicators {validate} | R Documentation

## Add indicator values as columns to a data frame

### Description

Compute and add externally defined indicators to data frame. If necessary, values are recycled over records.

### Usage

    add_indicators(dat, x)

### Arguments

`dat` | `[data.frame]`
`x` | `[indicator]` or `[indication]` object. See examples.

### Value

`dat` with extra columns defined by `x` attached.

### Examples

    ii <- indicator(
     hihi = 2*sqrt(height)
     , haha = log10(weight)
     , lulz = mean(height)
     , wo0t = median(weight)
    )

    # note: mean and median are repeated
    add_indicators(women, ii)

    # compute indicators first, then add
    out <- confront(women, ii)
    add_indicators(women, out)

[Package validate version 1.1.1 Index]