Produces a Markdown table output for objects obtained via
overview_tab and overview_crosstab
Usage
overview_markdown(
obj,
title = "Time and scope of the sample",
id = "Sample",
time = "Time frame",
crosstab = FALSE,
cond1 = "Condition 1",
cond2 = "Condition 2",
save_out = FALSE,
file_path = ""
)Arguments
- obj
Overview object produced by
overview_taboroverview_crosstab- title
Optional title printed as a Markdown heading above the table. Defaults to
"Time and scope of the sample".- id
The header of the left column (default is
"Sample"). Ignored whencrosstab = TRUE.- time
The header of the right column (default is
"Time frame"). Ignored whencrosstab = TRUE.- crosstab
Logical. If
TRUEproduces a cross-table output. Default isFALSE.- cond1
Label for the first condition. Ignored when
crosstab = FALSE.- cond2
Label for the second condition. Ignored when
crosstab = FALSE.- save_out
Logical. If
TRUEwrites the output to a file. Default isFALSE.- file_path
Path (including file name with
.mdextension) where the output is stored whensave_out = TRUE.
Value
Invisibly returns a character string with the Markdown table. The
table is also printed to the console (unless save_out = TRUE).
Examples
data(toydata)
overview_object <- overview_tab(dat = toydata, id = ccode, time = year)
overview_markdown(obj = overview_object)
#> ## Time and scope of the sample
#> | Sample | Time frame |
#> |--------|------------|
#> | AGO | 1990 - 1992 |
#> | BEN | 1995 - 1999 |
#> | FRA | 1993, 1996, 1999 |
#> | GBR | 1991, 1993, 1995, 1997, 1999 |
#> | RWA | 1990 - 1995 |
overview_ct_object <- overview_crosstab(
dat = toydata,
cond1 = gdp,
cond2 = population,
threshold1 = 25000,
threshold2 = 27000,
id = ccode,
time = year
)
overview_markdown(
obj = overview_ct_object,
crosstab = TRUE,
cond1 = "GDP",
cond2 = "Population"
)
#> ## Time and scope of the sample
#> | | **GDP**: Fulfilled | **GDP**: Not fulfilled |
#> |---|---|---|
#> | **Population**: Fulfilled | AGO (1990, 1992), FRA (1993), GBR (1997) | BEN (1996, 1999), FRA (1999), GBR (1993), RWA (1992, 1994) |
#> | **Population**: Not fulfilled | BEN (1997), RWA (1990) | AGO (1991), BEN (1995, 1998), FRA (1996), GBR (1991, 1995, 1999), RWA (1991, 1993, 1995) |
