# cell-specification

0th

Percentile

The range argument of read_excel() provides many ways to limit the read to a specific rectangle of cells. The simplest usage is to provide an Excel-like cell range, such as range = "D12:F15" or range = "R1C12:R6C15". The cell rectangle can be specified in various other ways, using helper functions. In all cases, cell range processing is handled by the cellranger package, where you can find full documentation for the functions used in the examples below.

The cellranger package has full documentation on cell specification and offers additional functions for manipulating "A1:D10" style spreadsheet ranges. Here are the most relevant:

• cellranger::cell_limits()

• cellranger::cell_rows()

• cellranger::cell_cols()

• cellranger::anchored()

##### Aliases
• cell-specification
• cell_limits
• cell_rows
• cell_cols
• anchored
##### Examples
# NOT RUN {
## Rows 1 and 2 are empty (as are rows 7 and higher)
## Column 1 aka "A" is empty (as are columns 5 of "E" and higher)

# By default, the populated data cells are "shrink-wrapped" into a
# minimal data frame

# Specific rectangle that is subset of populated cells, possibly improper

# Specific rectangle that forces inclusion of unpopulated cells

# Anchor a rectangle of specified size at a particular cell
read_excel(path, range = anchored("C4", dim = c(3, 2)), col_names = FALSE)

# Specify only the rows or only the columns

# Specify exactly one row or column bound

# General open rectangles
# upper left = C4, everything else unspecified
read_excel(path, range = cell_limits(c(4, 3), c(NA, NA)))
# upper right = D4, everything else unspecified
read_excel(path, range = cell_limits(c(4, NA), c(NA, 4)))

# }