Learn R Programming

LifeInsureR (version 1.0.0)

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

Description

This function is just a trivial wrapper around pad0 and only calls pad0() with the last element of the vector as padding value instead of the default 0.

Usage

padLast(v, ...)

Value

vector padded to the correct length

Arguments

v

the vector to pad by repeating the last element

...

arguments passed through to pad0

Examples

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

Run the code above in your browser using DataLab