Skip to contents

Creates a flextable in WaSHI's style.

Usage

washi_flextable(
  data,
  cols_bold = NULL,
  header_font = "Lato",
  body_font = "Poppins",
  header_font_color = "white",
  header_bg_color = washi_pal[["standard"]][["green"]],
  border_color = washi_pal[["standard"]][["tan"]]
)

Arguments

data

Dataframe for the table.

cols_bold

Numeric indices of columns to bold. Defaults to NULL.

header_font

Font family for header text. Defaults to "Lato".

body_font

Font family for table body text. Defaults to "Poppins".

header_font_color

Hexcode color for header font. Defaults to white.

header_bg_color

Hexcode color for header background. Defaults to WaSHI green.

border_color

Hexcode color for horizontal borders. Defaults to WaSHI tan.

Value

A flextable formatted in WaSHI's style.

Examples

subset(
  example_data_wide,
  select = c(
    "sampleId",
    "county",
    "crop",
    "totalN_%",
    "totalC_%"
  )
) |>
  washi_flextable(cols_bold = 1)
#> Couldn't find 'sans'. Defaulting to 'sans'.

sampleId

county

crop

totalN_%

totalC_%

D030301

D

Wheat

0.08

0.67

D030302

D

CRP/Conservation

0.09

0.94

D040401

D

Apple

0.09

0.87

D040402

D

Green Manure

0.10

1.12

D040403

D

Cherry

0.09

0.86

D040404

D

Green Manure

0.13

1.56

B010101

B

Hops

0.10

1.01

B010102

B

Hops

0.11

0.94

B010103

B

Hops

0.11

1.08

B010104

B

Hops

0.11

1.06

B010105

B

Hops

0.09

0.83

B010106

B

Hops

0.10

0.90

F050501

F

Potato

0.03

0.38

F050502

F

Potato

0.06

0.63

F050503

F

Potato

0.05

0.51

B020201

B

Potato

0.05

0.48

B020202

B

Potato

0.05

0.56

B020203

B

Potato

0.08

0.65

W101001

W

Bean, Garbanzo

0.15

2.04

W101002

W

Bean, Garbanzo

0.15

2.32

W080801

W

Bean, Garbanzo

0.15

2.04

W080802

W

Pea

0.15

2.08

W090901

W

Bean, Garbanzo

0.11

1.37

W090902

W

Bean, Garbanzo

0.14

1.92

O060601

O

Apple

0.16

2.12

O060602

O

Apple

0.18

2.44

O070701

O

Apple

0.16

2.17

O070702

O

Apple

0.14

1.59

Y111101

Y

Apple

0.09

0.88

Y111102

Y

Apple

0.12

1.33