addIntercept: Internal function to add a column for the intercept to a...

View source: R/utilities.R

addInterceptR Documentation

Internal function to add a column for the intercept to a matrix.

Description

Given a matrix or data.frame of size nxp, returns an nx(p+1) object of the same type where the first column is an intercept if the intercept is not already in the object (defined as a first column being all 1's).

Usage

addIntercept(x)

Arguments

x

A matrix or data.frame.

Value

A matrix (if x is a matrix) or data.frame (if x is a data.frame) guaranteed to have an intercept column.


josherrickson/epb documentation built on July 6, 2023, 9:12 p.m.