h2o.pivot: Pivot a frame

Description Usage Arguments Value Examples

View source: R/frame.R

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

1
h2o.pivot(x, index, column, value)

Arguments

x

an H2OFrame

index

the column where pivoted rows should be aligned on

column

the column to pivot

value

values of the pivoted table

Value

An H2OFrame with columns from the columns arg, aligned on the index arg, with values from values arg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
library(h2o)
h2o.init()

df = h2o.createFrame(rows = 1000, cols = 3, factors = 10, integer_fraction = 1.0/3, 
                     categorical_fraction = 1.0/3, missing_fraction = 0.0, seed = 123)
df$C3 = h2o.abs(df$C3)
h2o.pivot(df, index="C3", column="C2", value="C1")

## End(Not run)

h2o documentation built on Oct. 10, 2021, 1:08 a.m.