Some simple functions that may be useful. Just simple shortcuts.
Usage
i2a(i,n)
trim(x)
matsum(x, ...)
checknull(x, default=0)
Arguments
- i,n
integers
- x
A matrix or array (matsum), a character string(trim)...
- default
The value given if x=NULL.
- ...
More arguments to summary
.
Value
i2a
formats i as an integer of the required length with zero padding.
matsum
is simply the summary of all the matrix columns at once, i.e. x treated as a vector.
trim
strip sleading and trailing blanks from a string.
checknull
will replace a NULL value by the default value.