Learn R Programming

translateSPSS2R (version 1.0.0)

computeChar_rpad: Expand strings on the right

Description

Helper Function for xpssCompute. R Implementation of the SPSS CHAR.RPAD Function.

Usage

computeChar_rpad (x, length = NULL, fill = NULL)

Arguments

x
atomic character or character vector.
length
numeric. Number of characters x is to be filled on the right.
fill
optional. String which x should be filled with.

Value

String, right-padded by length length.

Details

The value of length represents the number of characters and must be a positive integer. If the optional argument fill is not specified, x is padded with blank spaces.

See Also

paste0

Examples

Run this code
xpssCompute(x="My Friend", fun="computeChar_rpad", length=15)
xpssCompute(x="My Friend", fun="computeChar_rpad", length=15, fill = "Hello")

Run the code above in your browser using DataLab