Learn R Programming

cellranger (version 0.1.0)

cell_limits: Create a cell_limits object

Description

The expectation is that as.cell_limits will be called to process user-provided input on the target cell range for read/write operations on a spreadsheet. Downstream code can be written assuming cell limits are stored in a valid cell_limits object.

Usage

cell_limits(rows = c(NA_integer_, NA_integer_), cols = c(NA_integer_,
  NA_integer_))

## S3 method for class 'cell_limits': dim(x)

as.cell_limits(x)

## S3 method for class 'cell_limits': as.cell_limits(x)

## S3 method for class 'character': as.cell_limits(x)

Arguments

rows
vector holding minimum and maximum row
cols
vector holding minimum and maximum col
x
input to convert into a cell_limits object

Value

  • a cell_limits object

Details

A cell_limits object is a list with two components:

  • rowsvector, of the formc(min, max)
  • colsvector, of the formc(min, max)

Typically the min and max are positive integers, where the first (the minimum) is less than or equal to the second (the maximum). A value of NA means the corresponding limit is left unspecified. Therefore a verbose way to specify no limits at all would be cell_limits(c(NA, NA), c(NA, NA)).

Spreadsheet ranges can be specified using "A1" notation or "R1C1" notation and dollar signs will be ignored, i.e. "A$1:$B$32" is equivalent to "A1:B32".

Examples

Run this code
cell_limits(c(1, 3), c(1, 5))
cell_limits(c(NA, 7), c(3, NA))
cell_limits(c(NA, 7))
cell_limits(cols = c(NA, 7))

dim(as.cell_limits("A1:F10"))
dim(cell_limits(cols = c(2, 5)))
as.cell_limits("A1")
as.cell_limits("Q24")
as.cell_limits("A1:D8")
as.cell_limits("R5C11")
as.cell_limits("R2C3:R6C9")

Run the code above in your browser using DataLab