
Head and tail type tabularise generic (tabularise$headtail)
Source:R/tabularise_headtail.R
tabularise_headtail.Rd
The "headtail" type for tabularise presents the first (head) and last (tail)
few lines of a table. This is useful for a long table and often more useful
than just displaying only the first few lines of the same table (that you got
with the default type, see tabularise_default()
).
Usage
tabularise_headtail(data, n = 10, ..., kind = "ft", env = env)
# S3 method for default
tabularise_headtail(data, n = 10, ..., kind = "ft", env = env)
# S3 method for data.frame
tabularise_headtail(
data,
n = 10,
auto.labs = TRUE,
sep = "...",
...,
lang = getOption("data.io_lang", "en"),
kind = "ft",
env = env
)
Arguments
- data
An object
- n
The number of lines to display in the (truncated) table.
- ...
Further arguments (depending on the object class).
- kind
The kind of table to produce: "tt" for tinytable, or "ft" for flextable (default).
- env
The environment where to evaluate formulas (you probably do not need to change the default).
- auto.labs
Are labels automatically used for names of table columns?
- sep
The separator between the first and last lines of a table. By default, the vertical ellipse shape is used.
- lang
the natural language to use. The default value can be set with, e.g.,
options(data.io_lang = "fr")
for French.
Value
A flextable object you can print in different form or rearrange with the {flextable} functions from set Stb$verb().
Examples
tabularise$headtail(iris)
Sepal.Length
Sepal.Width
Petal.Length
Petal.Width
Species
5.1
3.5
1.4
0.2
setosa
4.9
3.0
1.4
0.2
setosa
4.7
3.2
1.3
0.2
setosa
4.6
3.1
1.5
0.2
setosa
5.0
3.6
1.4
0.2
setosa
...
...
...
...
...
6.7
3.0
5.2
2.3
virginica
6.3
2.5
5.0
1.9
virginica
6.5
3.0
5.2
2.0
virginica
6.2
3.4
5.4
2.3
virginica
5.9
3.0
5.1
1.8
virginica
First and last 5 rows of a total of 150