computeChar_mblen: Byte per character or sign

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/xpssComputeStrings.R

Description

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

Usage

1
computeChar_mblen (x,pos = NULL)

Arguments

x

character vector, or a vector to be coerced to a character vector. Giving a factor is an error.

pos

position of character or sign the number of bytes return to.

Details

Important for Asian languages, where a character can fill more than one byte.

Value

Numeric. Returns the number of bytes in the character at position pos in x.

Author(s)

Bastian Wiessner

See Also

nchar

Examples

1
2
#Returns 1 cause the letter "R" fills one byte.
xpssCompute(x="R is great!", fun="computeChar_mblen", pos=2)

translateSPSS2R documentation built on May 30, 2017, 4:31 a.m.