S3 method for quantities objects (see rep).
Usage
# S3 method for class 'quantities'
rep(x, ...)Arguments
- x
a vector (of any mode including a
list) or a factor or (forreponly) aPOSIXctorPOSIXltorDateobject; or an S4 object containing such an object.- ...
further arguments to be passed to or from other methods. For the internal default method these can include:
timesan integer-valued vector giving the (non-negative) number of times to repeat each element if of length
length(x) * each, or to repeat the whole vector if of length 1. Negative orNAvalues are an error. Adoublevector is accepted, other inputs being coerced to an integer or double vector.length.outnon-negative integer. The desired length of the output vector. Other inputs will be coerced to a double vector and the first element taken. Ignored if
NAor invalid.eachnon-negative integer. Each element of
xis repeatedeachtimes. Other inputs will be coerced to an integer or double vector and the first element taken. Treated as1ifNAor invalid.
Examples
rep(set_quantities(1, m/s, 0.1), 4)
#> Units: [m/s]
#> Errors: 0.1 0.1 0.1 0.1
#> [1] 1 1 1 1