Learn R Programming

translateSPSS2R (version 1.0.0)

computeStrunc: Truncating strings

Description

Helper Function for xpssCompute. R Implementation of the SPSS STRUNC Function.

Usage

computeStrunc (x, length = NULL)

Arguments

x
input character vector.
length
length x is truncated to

Value

String. Returns x truncated to length (in bytes) and trimmed of remaining blanks.

See Also

str_sub

Examples

Run this code
xpssCompute(x="Hello    ", fun="computeStrunc", length=7)

Run the code above in your browser using DataLab