rStats.js v1.3.0
    Preparing search index...

    Interface PivotLongerOptions

    Options for pivotLonger (tidyr's arguments in camelCase).

    interface PivotLongerOptions {
        cols: readonly string[] | ((name: string) => boolean);
        colsVary?: "fastest" | "slowest";
        namesPattern?: string;
        namesPrefix?: string;
        namesSep?: string;
        namesTo?: string | readonly string[];
        namesTransform?: Readonly<Record<string, (part: string) => DataValue>>;
        onWarning?: (message: string) => void;
        valuesDropNa?: boolean;
        valuesTo?: string;
    }
    Index
    cols: readonly string[] | ((name: string) => boolean)

    The columns to pivot: their names, in this order, or a test of the name (selecting in the data's order).

    colsVary?: "fastest" | "slowest"

    "fastest" (default): the pivoted columns vary within each input row; "slowest": all rows for each column in turn. Any other value is an error, as in tidyr.

    namesPattern?: string

    A regular expression whose capture groups are the parts of the names.

    namesPrefix?: string

    A regular expression whose match at the start of the names is removed.

    namesSep?: string

    A regular expression at whose matches the names are split into the parts.

    namesTo?: string | readonly string[]

    The columns to make from the names, one per part of the names. ".value" marks the part that names the value columns. With [], no columns are made from the names (namesSep and namesPattern are not used). Default "name".

    namesTransform?: Readonly<Record<string, (part: string) => DataValue>>

    Functions applied to the parts, by namesTo column (the part as a string; missing parts stay missing). Own properties only: a namesTo column named toString has no transform unless one is given. The transform of ".value" gives the names of the value columns, and must return strings.

    onWarning?: (message: string) => void

    Called with each of tidyr's warnings, once per distinct warning, in order. Default: the warnings go to the handler of setWarningHandler (none by default).

    valuesDropNa?: boolean

    Drop the rows where every value column is missing. Default false.

    valuesTo?: string

    The name of the value column (without ".value" in namesTo). Default "value".