Learn R Programming

translateSPSS2R (version 1.0.0)

computeLength: Number of bytes in a string

Description

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

Usage

computeLength (x)

Arguments

x
character or character vector.

Value

Numeric. Returns the length of x in bytes, including all trailing blanks.

See Also

nchar

Examples

Run this code
xpssCompute(x="trailing blanks matter",fun="computeLength")
xpssCompute(x="trailing blanks matter                      ",fun="computeLength")
xpssCompute(x="                      trailing blanks matter",fun="computeLength")

Run the code above in your browser using DataLab