h2o.melt: Converts a frame to key-value representation while optionally...

View source: R/frame.R

h2o.meltR Documentation

Converts a frame to key-value representation while optionally skipping NA values. Inverse operation to h2o.pivot.

Description

Pivot the frame designated by the three columns: index, column, and value. Index and column should be of type enum, int, or time. For cases of multiple indexes for a column label, the aggregation method is to pick the first occurrence in the data frame

Usage

h2o.melt(
  x,
  id_vars,
  value_vars = NULL,
  var_name = "variable",
  value_name = "value",
  skipna = FALSE
)

Arguments

x

an H2OFrame

id_vars

the columns used as identifiers

value_vars

what columns will be converted to key-value pairs (optional, if not specified complement to id_vars will be used)

var_name

name of the key-column (default: "variable")

value_name

name of the value-column (default: "value")

skipna

if enabled, do not include NAs in the result (default: FALSE)

Value

an unpivoted H2OFrame


h2o documentation built on May 29, 2024, 4:26 a.m.