Skip to contents
loading...

tabularise() an htest object (into a a flextable) that can be further post-edited..

Usage

# S3 method for htest
tabularise_default(
  data,
  header = TRUE,
  title = NULL,
  lang = getOption("data.io_lang", "en"),
  show.signif.stars = getOption("show.signif.stars", TRUE),
  ...,
  kind = "ft",
  env = parent.frame()
)

Arguments

data

An htest object

header

If TRUE (by default), add a header to the table

title

If TRUE, add a title to the table header. Default to the same value than header, except outside of a chunk where it is FALSE if a table caption is detected (tbl-cap YAML entry).

lang

The natural language to use. The default value can be set with, e.g., options(data.io_lang = "fr") for French.

show.signif.stars

If TRUE, add the significance stars to the table. The default value is obtained from getOption("show.signif.stars"").

...

Additional arguments (unused for now).

kind

The kind of table to produce: "tt" for tinytable, or "ft" for flextable (default).

env

The environment where to evaluate lazyeval expressions (unused for now).

Value

A flextable object you can print in different forms or rearrange with the {flextable} functions.

Examples

data(iris)
iris_cor <- cor.test(iris$Sepal.Length, iris$Sepal.Width)
tabularise::tabularise(iris_cor)

Two sided Pearson’s product-moment correlation test

Pearson’s r coefficient (CI:95%)

tobs. value

Df

Value under H0

p value

-0.1 (-0.3-0.0)

-1.44

148

0

0.152

0 <= '***' < 0.001 < '**' < 0.01 < '*' < 0.05

tabularise::tabularise(t.test(x = 1:10, y = 7:20), lang = "fr")

Test t bilatéral d’indépendance à variances inégales (Welch)

Différence des moyennes (IC:95%)

Valeur de tobs.

Ddl

Valeur sous H0

Valeur de p

-8.0 (-11.1--4.9)

-5.43

22

0

1.86·10-05

***

0 <= '***' < 0.001 < '**' < 0.01 < '*' < 0.05