grouper: Transform a numeric vector by grouping it according to the...

rescale.by.groupR Documentation

Transform a numeric vector by grouping it according to the values of the supplied factor and then rescaling within the groups.

Description

The numeric vector is remapped to integers from 0 to max-1, with any missing values mapped to the midpoint. Original idea from Tony Nolan. This will eventually be generalised to do the remapping using any of the rescaling functions.

Usage

rescale.by.group(x, by=NULL, type = "irank", itop = 100)

Arguments

x

The numeric vector to rescale.

by

A factor of the same length as x used to define the groups.

type

The type of rescaling to perform.

itop

For an integer remapping this is the number of groups, so that the numeric values are maped to the integers from 0 to (max-1).

Details

This Rattle support function, which is also useful by itself, provides a simple mechanism to rescale a numeric variable. Several rescalings are possible. The rescaling is done by first grouping the observations according to the by argument.

Author(s)

Graham.Williams@togaware.com

References

Package home page: https://rattle.togaware.com

See Also

rattle.


rattle documentation built on March 21, 2022, 5:06 p.m.