Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

stringDims

String Dimentions


Description

Finds the height and width of all the string in a character vector.

Usage

stringDims(string)

Arguments

string

vector of strings

Details

stringDims finds the number of characters in width and number of lines in height for each string in the string argument.

Value

height

a vector of the number of lines in each string.

width

a vector with the number of character columns in the longest line.

Author(s)

Charles Dupont

See Also

Examples

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

Hmisc

Harrell Miscellaneous

v4.5-0
GPL (>= 2)
Authors
Frank E Harrell Jr <fh@fharrell.com>, with contributions from Charles Dupont and many others.
Initial release
2021-02-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.