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()
).
tabularise_headtail(data, n = 10, ..., kind = "ft", env = env)
# Default S3 method
tabularise_headtail(data, n = 10, ..., kind = "ft", env = env)
# S3 method for class 'data.frame'
tabularise_headtail(
data,
n = 10,
auto.labs = TRUE,
sep = "...",
...,
lang = getOption("SciViews_lang", "en"),
kind = "ft",
env = env
)
An object
The number of lines to display in the (truncated) table.
Further arguments (depending on the object class).
The kind of table to produce: "tt" for tinytable, or "ft" for flextable (default).
The environment where to evaluate formulas (you probably do not need to change the default).
Are labels automatically used for names of table columns?
The separator between the first and last lines of a table. By default, the vertical ellipse shape is used.
the natural language to use. The default value can be set with,
e.g., options(SciViews_lang = "fr")
for French.
A flextable object you can print in different form or rearrange with the {flextable} functions from set Stb$verb().
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