regressor.split: Split a single column of values into multiple columns as...

Description Usage Arguments Value

View source: R/util-regression.R

Description

Split a column of data by membership in discrete groups (as with factor levels) data into multiple columns containing just the values corresponding to the membership indicator associated with the column and zeros otherwise.

Usage

1
regressor.split(regressor, membership = NULL)

Arguments

regressor

The vector of data to be split

membership

A vector of the same length as the regressor that assigns group membership categorically. If the regressor is a factor, no membership assignment is required.

Value

A matrix of length(sort(unique(membership))) columns, that is all zeros except for the regressor values that match the membership values corresponding to the column. This supports regression with separate coefficints for each group defined by the membership for example, regressor.split(Tout,dates$hour) will return a matrix with 24 columns, where the only non-zero entry per row contains the Tout value in the column corresponding to the hour of day it was recorded


ConvergenceDA/visdom documentation built on May 6, 2019, 12:51 p.m.