Learn R Programming

translateSPSS2R (version 1.0.0)

computeChar_length: Length of a string in characters

Description

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

Usage

computeChar_length (x)

Arguments

x
atomic character or character vector.

Value

Numeric. Returns the length of x in characters, with any trailing blanks removed.

See Also

str_length

Examples

Run this code
xpssCompute(x="            please remove trailing blanks",fun="computeChar_length")

xpssCompute(x="please remove trailing blanks",fun="computeChar_length")

xpssCompute(x=c("please","remove","trailing","blanks"),fun="computeChar_length")

Run the code above in your browser using DataLab