padLast: Pad the vector 'v' to length 'l' by repeating the last entry...

View source: R/HelperFunctions.R

padLastR Documentation

Pad the vector v to length l by repeating the last entry of the vector.

Description

This function callc pad0() with the last element of the vector as padding value

Usage

padLast(v, l, start = 0)

Arguments

v

the vector to pad by repeating the last element

l

the desired (resulting) length of the vector

start

the first start values are always set to 0 (default is 0), the vector v starts only after these leading zeroes. The number of leading zeroes counts towards the desired length

Examples

padLast(1:5, 7) # 5 is repeated twice
padLast(1:5, 3) # no padding needed


kainhofer/r-life-insurance-contracts documentation built on Sept. 18, 2022, 7:56 p.m.