locate_data: Locates data cells

Description Usage Arguments Examples

View source: R/locate_data.R

Description

This function identifies which cells is a tidyxl dataframe represent data cells. It removes data cells from data frame and stores them in an attribute of the resulting tidyxl data frame.

Usage

1
locate_data(sheet = NULL, ...)

Arguments

sheet

a data frame produced by xlsx_cells

...

a filter expression that identifies data cells.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 

library(tidyverse)

# Read in tidyxl data frame
xl_df <- locatr_example("worked-examples.xlsx") %>% xlsx_cells_fmt(sheets = "pivot-hierarchy")

# Identify numeric cells as data cells using the data_type column of xl_df
xl_df <- xl_df %>% locate_data(data_type == "numeric")

# Visually inspect the result
xl_df %>% plot_cells()

## End(Not run)

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