as.cell_addr: Convert to a cell_addr object

Description Usage Arguments Value Examples

View source: R/cell-addr.R

Description

Convert various representations of a cell reference into an object of class cell_addr. Recall that cell_addr objects hold absolute row and column location, so ra_ref objects or cell reference strings with relative or mixed references will raise a warning and generate NAs.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
as.cell_addr(x, ...)

as.cell_addr_v(x, ...)

## S3 method for class 'ra_ref'
as.cell_addr(x, ...)

## S3 method for class 'list'
as.cell_addr_v(x, ...)

## S3 method for class 'character'
as.cell_addr(x, fo = NULL, strict = TRUE, ...)

## S3 method for class 'character'
as.cell_addr_v(x, fo = NULL, strict = TRUE, ...)

Arguments

x

a cell reference

...

further arguments passed to or from other methods

fo

either "R1C1" (the default) or "A1" specifying the cell reference format; in many contexts, it can be inferred and is optional

strict

logical, affects reading and writing of A1 formatted cell references. When strict = TRUE, references must be declared absolute through the use of dollar signs, e.g., $A$1, for parsing. When making a string, strict = TRUE requests dollar signs for absolute reference. When strict = FALSE, pure relative reference strings will be interpreted as absolute, i.e. A1 and $A$1 are treated the same. When making a string, strict = FALSE will cause dollars signs to be omitted in the reference string.

Value

a cell_addr object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
as.cell_addr(ra_ref())
rar <- ra_ref(2, TRUE, 5, TRUE)
as.cell_addr(rar)
## mixed reference
rar <- ra_ref(2, FALSE, 5, TRUE)
as.cell_addr(rar)
ra_ref_list <-
  list(ra_ref(), ra_ref(2, TRUE, 5, TRUE), ra_ref(2, FALSE, 5, TRUE))
as.cell_addr_v(ra_ref_list)
as.cell_addr("$D$12")
as.cell_addr("R4C3")
as.cell_addr(c("$C$4", "$D$12"))
as.cell_addr("$F2")
as.cell_addr("R[-4]C3")
as.cell_addr("F2", strict = FALSE)

jennybc/cellranger documentation built on May 19, 2019, 4:04 a.m.