unitted_c: Combine unitted elements into a unitted vector

Description Usage Arguments Details Value See Also

Description

This function takes one or more unitted elements and combines them into a single unitted vector. To enforce units integrity, the function requires that all elements passed to the S3 or S4 versions of c.unitted() must have the same units, at least when recursive=FALSE. When recursive=TRUE, elements may include lists or data.frames, but the base elements (vectors, columns, etc.) of those list elements must still be unitted.

To avoid repeating code, the S3 function simply calls the S4 method.

Usage

1
2
3
4
5
## S4 method for signature 'unitted'
c(x, ..., recursive = FALSE)

## S3 method for class 'unitted'
c(..., recursive = FALSE)

Arguments

x

the first argument passed to c

...

objects to be concatenated.

recursive

logical. If recursive = TRUE, the function recursively descends through lists (and pairlists) combining all their elements into a vector.

Details

The S4 method for c<<unitted>> will be found first (before other c() methods) whenever the first argument is unitted.

Value

A unitted vector

See Also

Other unitted object manipulation: unitted_bind, unitted_merge, unitted_rep


appling/unitted documentation built on May 10, 2019, 12:44 p.m.