select_fmt: Select keeping formats

Description Usage Arguments Examples

Description

A wrapper for dplyr::select that retains formatting information

Usage

1

Arguments

df

a data frame created by tidyxl::xlsx_cells

...

select input.

Examples

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


annotated_df <-
locatr_example("newresconst.xlsx") %>%
  xlsx_cells_fmt(sheets = "Table 1 - Permits") %>%
  append_fmt(fmt_font_bold) %>%
  filter_fmt(row < min(row[str_detect(character,"RSE")],na.rm = TRUE)) %>%
  select_fmt(-height) %>%
  locate_data(data_type == "numeric" & col > 1) %>%
  locate_groups(direction = "W",
                .groupings = groupings(is.na(numeric)),
                .hook_if = hook_if(any(data_type == "numeric"))) %>%
  locate_groups(direction = "N", header_fill = "style")

 annotated_df %>% plot_cells()
 
## End(Not run)

ianmoran11/locatr documentation built on June 14, 2020, 3:32 a.m.