invert_indexes: Invert and derive indexes

View source: R/impute.R

invert_indexesR Documentation

Invert and derive indexes

Description

Takes a list of elements and creates a new list containing 1 entry per unique element value containing the indexes of which original elements it occurred in.

Usage

invert_indexes(x)

Arguments

x

list of elements to invert and calculate index from (see details).

Details

This functions purpose is best illustrated by an example:

input:

list( c("A", "B", "C"), c("A", "A", "B"))}

becomes:

list( "A" = c(1,2,2), "B" = c(1,2), "C" = 1 )

rbmi documentation built on Nov. 24, 2023, 5:11 p.m.