A cell_limits object is a list with three components:
cell_limits(ul = c(NA_integer_, NA_integer_), lr = c(NA_integer_,
NA_integer_), sheet = NA_character_)
# 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 'NULL'
as.cell_limits(x, ...)
# S3 method for class 'character'
as.cell_limits(x, fo = NULL, ...)vector identifying upper left cell of target rectangle
vector identifying lower right cell of target rectangle
string containing worksheet name, optional
input to convert into a cell_limits object
further arguments passed to or from other methods
either "R1C1" (the default) or "A1" specifying the
cell reference format; in many contexts, it can be inferred and is optional
a cell_limits object
ul vector specifying upper left cell of target rectangle, of
the form c(ROW_MIN, COL_MIN)
lr vector specifying lower right cell of target rectangle, of
the form c(ROW_MAX, COL_MAX)
sheet string specifying worksheet name, which may be
NA, meaning it's unspecified
A value of NA in ul or lr 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)). If the maximum row or
column is specified but the associated minimum is not, then the minimum is
set to 1.
When specified via character, cell references can be given in A1 or R1C1
notation and must be interpretable as absolute references. For A1, this means
either both row and column are annotated with a dollar sign $ or
neither is. So, no mixed references, like B$4. For R1C1, this means no
square brackets, like R[-3]C[3].
cell_limits(c(1, 3), c(1, 5))
#> <cell_limits (1, 3) x (1, 5)>
cell_limits(c(NA, 7), c(3, NA))
#> <cell_limits (1, 7) x (3, -)>
cell_limits(c(NA, 7))
#> <cell_limits (-, 7) x (-, -)>
cell_limits(lr = c(3, 7))
#> <cell_limits (1, 1) x (3, 7)>
cell_limits(c(1, 3), c(1, 5), "Sheet1")
#> <cell_limits (1, 3) x (1, 5) in 'Sheet1'>
cell_limits(c(1, 3), c(1, 5), "Spaces are evil")
#> <cell_limits (1, 3) x (1, 5) in 'Spaces are evil'>
dim(as.cell_limits("A1:F10"))
#> Error in loadNamespace(x): there is no package called ‘rematch’
as.cell_limits("A1")
#> Error in loadNamespace(x): there is no package called ‘rematch’
as.cell_limits("$Q$24")
#> Error in loadNamespace(x): there is no package called ‘rematch’
as.cell_limits("A1:D8")
#> Error in loadNamespace(x): there is no package called ‘rematch’
as.cell_limits("R5C11")
#> Error in loadNamespace(x): there is no package called ‘rematch’
as.cell_limits("R2C3:R6C9")
#> Error in loadNamespace(x): there is no package called ‘rematch’
as.cell_limits("Sheet1!R2C3:R6C9")
#> Error in loadNamespace(x): there is no package called ‘rematch’
as.cell_limits("'Spaces are evil'!R2C3:R6C9")
#> Error in loadNamespace(x): there is no package called ‘rematch’
if (FALSE) { # \dontrun{
## explicitly mixed A1 references won't work
as.cell_limits("A$2")
## mixed or relative R1C1 references won't work
as.cell_limits("RC[4]")
} # }