getNChar: Get Number of Characters

Description Usage Arguments Value Author(s) Examples

Description

Get the number of characters in an object. It supports recursive counting for lists.

Usage

1
2
3
getNChar(x, rm.blank = TRUE, ...)

get_nchar(x, rm.blank = TRUE, ...)

Arguments

x

Object. Vector, matrix, list or data frame.

rm.blank

Logical: default TRUE, and ” will be coerced to NA.

...

Other arguments to pass to .getNChar

Value

An object of the same structure with x.

Author(s)

Yiying Wang, wangy@aetna.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
getNChar(c("dws", 23)) # return c(3, 2)

getNChar(matrix(c("dws", 23, "2332", 1), ncol=2))  # return
##       [,1] [,2]
## [1,]    3    4
## [2,]    2    1

getNChar(list("dws", 23, c("2332", 1)))  # return
## [[1]]
## [1] 3
##
## [[2]]
## [1] 2
##
## [[3]]
## [1] 4 1

## End(Not run)

madlogos/aseshms documentation built on May 21, 2019, 11:03 a.m.