File: labels.Rd

package info (click to toggle)
r-cran-sets 1.0.25%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 632 kB
  • sloc: ansic: 422; makefile: 7
file content (52 lines) | stat: -rwxr-xr-x 2,083 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
\name{labels}
\alias{LABELS}
\alias{LABEL}
\alias{LABEL.character}
\title{Labels from objects}
\description{
  Creates \dQuote{nice} labels from objects.
}
\usage{
LABELS(x, max_width = NULL, dots = "...", unique = FALSE,
       limit = NULL, \dots)
LABEL(x, limit = NULL, \dots)
\method{LABEL}{character}(x, limit = NULL, quote = sets_options("quote"), \dots)
}
\arguments{
  \item{x}{For \code{LABELS}, a vector of \R objects (if the object is
    not a vector, it is converted using \code{as.list}).
    For \code{LABEL}, an \R object.}
  \item{max_width}{Integer vector (recycled as needed) specifying the
    maximum label width for each component of \code{x}.
    If \code{NULL}, there is no limit, otherwise, the label will be
    truncated to \code{max_width}.}
  \item{dots}{A character string appended to a truncated label.
    If \code{NULL}, nothing is appended.}
  \item{unique}{Logical indicating whether
    \code{\link[base]{make.unique}} should be called on the final
    result.}
  \item{limit}{Maximum length of vectors or sets to be represented as
    is. Longer elements will be replaced by a label.}
  \item{quote}{Should character strings be quoted, or not?
    (default: \code{TRUE})}
  \item{\dots}{Optional arguments passed to the \code{LABEL} methods.}
}
\value{
  A character vector of labels generated from the supplied object(s).
  \code{LABELS} first checks whether the object has names and uses these
  if any; otherwise, \code{LABEL} is called for each element to generate
  a \dQuote{short} representation.

  \code{LABEL} is generic to allow user extensions.
  The current methods return the result of \code{\link{format}} if the
  argument is of length 1 (for objects of classes \code{\link{set}} and
  \code{\link{tuple}}: by default of length 5), and create a simple class
  information otherwise.
}
\examples{
LABELS(list(1, "test", X = "1", 1:5))
LABELS(set(X = as.tuple(1:20), "test", list(list(list(1,2)))))
LABELS(set(pair(1,2), set("a", 2), as.tuple(1:10)))
LABELS(set(pair(1,2), set("a", 2), as.tuple(1:10)), limit = 11)
}
\keyword{math}