mmtable: Create an mmtable object

Description Usage Arguments Value Examples

View source: R/mmtable.R

Description

Create an mmtable object

Usage

1
2
3
4
5
6
7
mmtable(
  data,
  cells,
  table_name = NULL,
  use_default_formats = TRUE,
  table_data = NULL
)

Arguments

data

a data frame

cells

the name of the column whose values will form the data cells.

table_name

the name of the table - used for labeling when joined with another table - randomly generated if not provided.

use_default_formats

determines whether or note the table will have default formatting applied. Default value = TRUE.

table_data

deprecated. Use 'cells' instead.

Value

mmtable

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 

library(tidyverse)

row_list <- cells_body(rows = c(1,3,5,7,9,11))
style_list <- list(cell_borders(sides = "top",color = "grey"))
gm_df <- gapminder_mm %>% dplyr::filter(var != "Life expectancy")

gm_table <-
  gm_df %>%
  mmtable(cells = value) +
  header_top(year) +
  header_left(country) +
  header_top_left(var)  +
  header_left_top(continent)  +
  table_format(
    locations = row_list,
    style = style_list)

## End(Not run)

ianmoran11/mmtable2 documentation built on Dec. 20, 2021, 5:58 p.m.