forked from r-lib/pillar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew_pillar.Rd
More file actions
49 lines (42 loc) · 1.57 KB
/
Copy pathnew_pillar.Rd
File metadata and controls
49 lines (42 loc) · 1.57 KB
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ctl_pillar.R
\name{new_pillar}
\alias{new_pillar}
\title{Construct a custom pillar object}
\usage{
new_pillar(components, ..., width = NULL, class = NULL, extra = deprecated())
}
\arguments{
\item{components}{A named list of components constructed with \code{\link[=pillar_component]{pillar_component()}}.}
\item{...}{These dots are for future extensions and must be empty.}
\item{width}{Default width, optional.}
\item{class}{Name of subclass.}
\item{extra}{Deprecated.}
}
\value{
A pillar object with the given components.
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}}
\code{new_pillar()} is the low-level constructor for pillar objects.
It supports arbitrary components.
See \code{\link[=pillar]{pillar()}} for the high-level constructor with default components.
}
\details{
Arbitrary components are supported.
If your tibble subclass needs more or different components in its pillars,
override or extend \code{\link[=ctl_new_pillar]{ctl_new_pillar()}} and perhaps \code{\link[=ctl_new_pillar_list]{ctl_new_pillar_list()}}.
}
\examples{
lines <- function(char = "-") {
stopifnot(nchar(char) == 1)
structure(char, class = "lines")
}
format.lines <- function(x, width, ...) {
paste(rep(x, width), collapse = "")
}
new_pillar(list(
title = pillar_component(new_ornament(c("abc", "de"), align = "right")),
lines = new_pillar_component(list(lines("=")), width = 1)
))
}