| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/misc.R |
| 3 |
\name{cbind.units} |
| 4 |
\alias{cbind.units} |
| 5 |
\alias{rbind.units} |
| 6 |
\title{Combine R Objects by Rows or Columns} |
| 7 |
\usage{ |
| 8 |
\method{cbind}{units}(..., deparse.level = 1) |
| 9 |
|
| 10 |
\method{rbind}{units}(..., deparse.level = 1) |
| 11 |
} |
| 12 |
\arguments{ |
| 13 |
\item{...}{(generalized) vectors or matrices. These can be given as named |
| 14 |
arguments. Other \R objects may be coerced as appropriate, or S4 |
| 15 |
methods may be used: see sections \sQuote{Details} and |
| 16 |
\sQuote{Value}. (For the \code{"data.frame"} method of \code{cbind} |
| 17 |
these can be further arguments to \code{\link[base]{data.frame}} such as |
| 18 |
\code{stringsAsFactors}.)} |
| 19 |
|
| 20 |
\item{deparse.level}{integer controlling the construction of labels in |
| 21 |
the case of non-matrix-like arguments (for the default method):\cr |
| 22 |
\code{deparse.level = 0} constructs no labels;\cr |
| 23 |
the default \code{deparse.level = 1} typically and |
| 24 |
\code{deparse.level = 2} always construct labels from the argument |
| 25 |
names, see the \sQuote{Value} section below.} |
| 26 |
} |
| 27 |
\description{ |
| 28 |
S3 methods for \code{units} objects (see \code{\link[base]{cbind}}). |
| 29 |
} |
| 30 |
\examples{ |
| 31 |
x <- set_units(1, m/s) |
| 32 |
y <- set_units(1:3, m/s) |
| 33 |
z <- set_units(8:10, m/s) |
| 34 |
(m <- cbind(x, y)) # the '1' (= shorter vector) is recycled |
| 35 |
(m <- cbind(m, z)[, c(1, 3, 2)]) # insert a column |
| 36 |
(m <- rbind(m, z)) # insert a row |
| 37 |
} |