towide: Reshape rows into columns

View source: R/primitives.R

towideR Documentation

Reshape rows into columns

Description

Reshape rows into columns

Usage

towide(data, names, values, idcols = NULL, fun = NULL, fill = NA)

Arguments

data

A data.frame.

names

Name for the resulting key/value column, depending on the function.

values

Vector or list of replacement values.

idcols

Columns to keep as row identifiers.

fun

Function applied to each element, column, or group.

fill

Value used for positions where no window/result is available.

Value

A wide-format basetable.


basetable documentation built on Sept. 18, 2026, 9:13 a.m.