statar (version 0.4.0)

tag: Creates a vector of zero except for one subscript

Description

Creates a vector of zero except for one subscript

Usage

tag(n, fromLast = FALSE)

Arguments

n
An integer (size of output)
fromLast
Should 1 be at the end?

Value

  • A vector of zeros except one subscript equal to one.

Examples

Run this code
tag(2)
tag(2, fromLast = TRUE)

Run the code above in your browser using DataCamp Workspace