Learn R Programming

LifeInsuranceContracts (version 0.0.2)

padLast: 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

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

# }

Run the code above in your browser using DataLab