countChar: 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
countChar(x, rm.blank = TRUE, ...)

count_char(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 .countChar

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: 
count_char(c("dws", 23)) # return c(3, 2)

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

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

## End(Not run)

madlogos/aseskit documentation built on June 26, 2019, 12:17 a.m.