expandDataFrame: Expands a data frame by merging with a MxN permutation...

Description Usage Arguments Value Examples

Description

Expands a data frame by merging with a MxN permutation data.frame filled with 0 or other

Usage

1
expandDataFrame(df, namex, x, namey, y, namez, z.val = 0)

Arguments

df

input data frame

namex

variable name for rows

x

vector of values of rows

namey

variable name for columns

y

vector of values of columns

namez

name of the merged field, usually a count

z.val

value to fill the merged column with

Value

a filled data frame

Examples

1
2
3
heatmap_pivot <- expandDataFrame(visit_pivot, 'hour', c(0:23), 'wday', c(1:7), 'count')
heatmap_visits <- reshape(heatmap_pivot,  idvar="hour",timevar="wday",direction="wide")
heatmap_visits$hour <- NULL

alesaccoia/alexr documentation built on Dec. 19, 2021, 12:26 a.m.