string.bounding.box {Hmisc}R Documentation

Determine Diamentions of Strings

Description

This determins the number of rows and maximum number of columns of each string in a vector.

Usage

string.bounding.box(string, type = c("chars", "width"))

Arguments

string character vector, or a vector to be coerced to a character vector
type character string: How the length of the string should be measured. See Details.

Details

The length of a string can be measured in one of two ways. See nchar Details section for more info.

`chars' The number of human readable characters.

`width' The number of columns used to print the string.

Value

rows vector containing the number of character rows in each string.
columns vector containing the maximum number of characters or character columns in each string.

Note

compatable with Splus string.bounding.box

Author(s)

Charles Dupont

See Also

nchar, stringDims

Examples

a <- c("this is a single line string", "This is a\nmulty line string")
stringDims(a)

[Package Hmisc version 3.4-3 Index]