Learn R Programming

Hmisc (version 5.1-3)

printL: printL

Description

Print an object or a named list of objects. When multiple objects are given, their names are printed before their contents. When an object is a vector that is not longer than maxoneline and its elements are not named, all the elements will be printed on one line separated by commas. When dec is given, numeric vectors or numeric columns of data frames or data tables are rounded to the nearest dec before printing. This function is especially helpful when printing objects in a Quarto or RMarkdown document and the code is not currently being shown to place the output in context.

Usage

printL(..., dec = NULL, maxoneline = 5)

Value

nothing

Arguments

...

any number of objects to print()

dec

optional decimal places to the right of the decimal point for rounding

maxoneline

controls how many elements may be printed on a single line for vector objects

Author

Frank Harrell

See Also

prn()

Examples

Run this code
w <- pi + 1 : 2
printL(w=w)
printL(w, dec=3)
printL('this is it'=c(pi, pi, 1, 2),
       yyy=pi,
       z=data.frame(x=pi+1:2, y=3:4, z=c('a', 'b')),
       qq=1:10,
       dec=4)
       

Run the code above in your browser using DataLab