Skip to contents
loading...

The "default" type is the most obvious tabular representation for an object. For data frames, it tabularises the first few rows and columns (so, in case of a very large object, output remains limited). See also the "headtail" type that creates a table with the few first and last rows of the table (see tabularise_headtail()).

Usage

tabularise_default(data, ..., kind = "ft", env = parent.frame())

# S3 method for default
tabularise_default(data, ..., kind = "ft", env = parent.frame())

# S3 method for data.frame
tabularise_default(
  data,
  formula = NULL,
  col_keys = names(data),
  cwidth = 0.75,
  cheight = 0.25,
  max.rows = 50,
  max.cols = 15,
  auto.labs = TRUE,
  ...,
  env = parent.frame()
)

# S3 method for matrix
tabularise_default(
  data,
  col_keys = colnames(data),
  rownames = " ",
  cwidth = 0.75,
  cheight = 0.25,
  ...,
  env = parent.frame()
)

# S3 method for Correlation
tabularise_default(
  data,
  col_keys = colnames(data),
  rownames = " ",
  header = TRUE,
  title = header,
  footer = TRUE,
  cwidth = 0.75,
  cheight = 0.25,
  lang = getOption("data.io_lang", "en"),
  ...,
  env = parent.frame()
)

Arguments

data

An object

...

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).

formula

A formula to create a table using the {tables} syntax

col_keys

The names/keys to use for the table columns

cwidth

Initial width for cell sizes in inches

cheight

Initial height for cell sizes in inches

max.rows

The maximum number of rows to display in the table

max.cols

The maximum number of columns to display in the table

auto.labs

Are labels automatically used for names of table columns?

rownames

col_keys to use for row names. If FALSE, do not add row names. If a string, a first column is added in the table with that string as label

header

do we add a header?

title

do we add a title?

footer

do we add a footer?

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$default(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

5.4

3.9

1.7

0.4

setosa

4.6

3.4

1.4

0.3

setosa

5.0

3.4

1.5

0.2

setosa

4.4

2.9

1.4

0.2

setosa

4.9

3.1

1.5

0.1

setosa

5.4

3.7

1.5

0.2

setosa

4.8

3.4

1.6

0.2

setosa

4.8

3.0

1.4

0.1

setosa

4.3

3.0

1.1

0.1

setosa

5.8

4.0

1.2

0.2

setosa

5.7

4.4

1.5

0.4

setosa

5.4

3.9

1.3

0.4

setosa

5.1

3.5

1.4

0.3

setosa

5.7

3.8

1.7

0.3

setosa

5.1

3.8

1.5

0.3

setosa

5.4

3.4

1.7

0.2

setosa

5.1

3.7

1.5

0.4

setosa

4.6

3.6

1.0

0.2

setosa

5.1

3.3

1.7

0.5

setosa

4.8

3.4

1.9

0.2

setosa

5.0

3.0

1.6

0.2

setosa

5.0

3.4

1.6

0.4

setosa

5.2

3.5

1.5

0.2

setosa

5.2

3.4

1.4

0.2

setosa

4.7

3.2

1.6

0.2

setosa

4.8

3.1

1.6

0.2

setosa

5.4

3.4

1.5

0.4

setosa

5.2

4.1

1.5

0.1

setosa

5.5

4.2

1.4

0.2

setosa

4.9

3.1

1.5

0.2

setosa

5.0

3.2

1.2

0.2

setosa

5.5

3.5

1.3

0.2

setosa

4.9

3.6

1.4

0.1

setosa

4.4

3.0

1.3

0.2

setosa

5.1

3.4

1.5

0.2

setosa

5.0

3.5

1.3

0.3

setosa

4.5

2.3

1.3

0.3

setosa

4.4

3.2

1.3

0.2

setosa

5.0

3.5

1.6

0.6

setosa

5.1

3.8

1.9

0.4

setosa

4.8

3.0

1.4

0.3

setosa

5.1

3.8

1.6

0.2

setosa

4.6

3.2

1.4

0.2

setosa

5.3

3.7

1.5

0.2

setosa

5.0

3.3

1.4

0.2

setosa

100 more rows

# Same as simply: tabularise(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

5.4

3.9

1.7

0.4

setosa

4.6

3.4

1.4

0.3

setosa

5.0

3.4

1.5

0.2

setosa

4.4

2.9

1.4

0.2

setosa

4.9

3.1

1.5

0.1

setosa

5.4

3.7

1.5

0.2

setosa

4.8

3.4

1.6

0.2

setosa

4.8

3.0

1.4

0.1

setosa

4.3

3.0

1.1

0.1

setosa

5.8

4.0

1.2

0.2

setosa

5.7

4.4

1.5

0.4

setosa

5.4

3.9

1.3

0.4

setosa

5.1

3.5

1.4

0.3

setosa

5.7

3.8

1.7

0.3

setosa

5.1

3.8

1.5

0.3

setosa

5.4

3.4

1.7

0.2

setosa

5.1

3.7

1.5

0.4

setosa

4.6

3.6

1.0

0.2

setosa

5.1

3.3

1.7

0.5

setosa

4.8

3.4

1.9

0.2

setosa

5.0

3.0

1.6

0.2

setosa

5.0

3.4

1.6

0.4

setosa

5.2

3.5

1.5

0.2

setosa

5.2

3.4

1.4

0.2

setosa

4.7

3.2

1.6

0.2

setosa

4.8

3.1

1.6

0.2

setosa

5.4

3.4

1.5

0.4

setosa

5.2

4.1

1.5

0.1

setosa

5.5

4.2

1.4

0.2

setosa

4.9

3.1

1.5

0.2

setosa

5.0

3.2

1.2

0.2

setosa

5.5

3.5

1.3

0.2

setosa

4.9

3.6

1.4

0.1

setosa

4.4

3.0

1.3

0.2

setosa

5.1

3.4

1.5

0.2

setosa

5.0

3.5

1.3

0.3

setosa

4.5

2.3

1.3

0.3

setosa

4.4

3.2

1.3

0.2

setosa

5.0

3.5

1.6

0.6

setosa

5.1

3.8

1.9

0.4

setosa

4.8

3.0

1.4

0.3

setosa

5.1

3.8

1.6

0.2

setosa

4.6

3.2

1.4

0.2

setosa

5.3

3.7

1.5

0.2

setosa

5.0

3.3

1.4

0.2

setosa

100 more rows