as_fmt_char: Format vector to printable string

View source: R/ascii_tables.R

as_fmt_charR Documentation

Format vector to printable string

Description

Coerces a vector of any type into a printable string. The most significant transformation is performed on existing character vectors which will be truncated, have newlines converted to explicit symbols and will be wrapped in quotes if they contain white space.

Usage

as_fmt_char(x, ...)

## S3 method for class 'numeric'
as_fmt_char(x, ...)

## S3 method for class ''NULL''
as_fmt_char(x, ...)

## S3 method for class 'list'
as_fmt_char(x, ...)

## S3 method for class 'factor'
as_fmt_char(x, ...)

## S3 method for class 'character'
as_fmt_char(x, add_quotes = TRUE, crop_at = 30, ...)

## Default S3 method:
as_fmt_char(x, ...)

## S3 method for class 'POSIXt'
as_fmt_char(x, ...)

Arguments

x

(vector)
vector to be converted to character

...

additional arguments (not currently used)

add_quotes

(logical)
if true will wrap strings that contain whitespace with quotes

crop_at

(numeric)
specifies the limit at which strings should be truncated to


diffdf documentation built on Sept. 30, 2024, 9:25 a.m.