add_index: Add index

Description Usage Arguments Value

Description

Add a rowwise mean or sum index of specific variables to the dataset.

Usage

1
add_index(data, name, ..., type = "mean", na.rm = T)

Arguments

data

A (tidy) dataset.

name

Name of the index column to compute.

...

Variables used for the index.

type

Type of index to compute. Either "mean" (default) or "sum".

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds. Defaults to TRUE.

Value

A tibble of the original datset with the added index column.


joon-e/jutilities documentation built on May 28, 2019, 7:34 p.m.