basisVector: Creates a standard basis vector.

View source: R/utilities.R View source: R/HonestDiD-Temp.R

basisVectorR Documentation

Creates a standard basis vector.

Description

Creates a basis vector of length size with a 1 in the index position.

Usage

# Create the index basis vector in R^size
basisVector(index, size)

Arguments

index

The index at which there should be a one. Default equals one.

size

The length of the vector. Default equals one.

Value

Returns a basis vector of length size with a 1 in the index position.

Examples

  # Create the first basis vector in R^2
  basisVector(index = 1, size = 2)
  # Create the third basis vector in R^6
  basisVector(index = 3, size = 6)

asheshrambachan/HonestDiD documentation built on July 15, 2024, 12:56 p.m.