qPrint: rendering lines and tables with quantities and other values

Description Usage Arguments Details Value Add functions Examples

Description

rendering lines and tables with quantities and other values

Usage

1
2
3
4
5
6
7
newQLines()

newQTable()

printQLines(envir, file = "", ...)

printQTable(envir, maxRows = 24, file = "", ...)

Arguments

envir

the envirionment created with newQlines or newQtable

file

a character string with a file path and name

...

are used only as a sink for superfluous parameters

maxRows

the maximum number of table rows to printed, default = 24

Details

The printQlines will print the lines added to a lines environment. printQtable will print all columns added to a table environment.

Value

Both newQlines and newQtable return a new environment for the lines / table to be printed. Both environments inclued an add() function for adding lines / columns.

Add functions

newQlines and newQtable create an envivonment with an add() function for for adding text lines and columns respectively. The add() function have the following parameters:
i (for lines only) a character string with the item designation
itemOnly (for lines only) a logical indicating a caption, i.e. an item without a value
h (columns only) a character string with a column header. For multi line headers use a character vector
v a list or vector with values to be printed
u a character string specifying the units of measurement with two special values 'symbol' and 'text' signifying the rendering of quantity units (default 'text' for lines and 'symbol' for tables)
etc (lines only) a character string with additional text added to the end of the line
null a character string for NULL value replacements, default 'NULL'
skipAllNull a logical indiating whether or not a line or column with all null values should be skiped or not, default TRUE
na a character string for NA value replacements, default 'NA'
nan a character string for NaN value replacements, default 'NaN'
zero a character string for 0 value replacements, default 0
pInf a character string for Inf value replacements, default 'Inf'
mInf a character string for -Inf value replacements, default '-Inf'
true a character string for TRUE value replacements, default a check mark
false a character string for FALSE value replacements, default ”
allign with a column allignment. The possible values 'default', 'left' 'centre', 'right' and 'dot' may be abbreviated.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
qL<- newQLines()
qL$add ('Recoring', 'new recording')
qL$add ('Date', Sys.time())
duration <- as.quantity (27000, 'time$second')
qL#add ('duration', duration)
qL$add ('sample rate', 44100, etc='/sec')
printQLines (qL)
qT <- newQTable ()
qT$add ('channel', c(1,2,3,4))
qT$add ('filtered', c(TRUE, FALSE, TRUE, FALSE), allign = 'c')
qT$add ('sampleRate', c(512, 256, 512, 256), u='/sec')
qT$add (c('signal', 'max'), c(.123, 21.12, 21, 5421))
printQTable (qT)

Pisca46/quantities documentation built on May 31, 2019, 11:41 p.m.