The ra_ref class is used to represent a single relative, absolute, or
mixed cell reference, presumably found in a formula. When row_abs is
TRUE, it means that row_ref identifies a specific row in an
absolute sense. When row_abs is FALSE, it means that
row_ref holds a positive, zero, or negative offset relative to the
address of the cell containing the formula that contains the associated cell
reference. Ditto for col_abs and col_ref.
ra_ref(row_ref = 1L, row_abs = TRUE, col_ref = 1L, col_abs = TRUE,
sheet = NA_character_, file = NA_character_)integer, row or row offset
logical indicating whether row_ref is absolute or
relative
integer, column or column offset
logical indicating whether col_ref is absolute or
relative
the name of a sheet (a.k.a. worksheet or tab)
the name of a file (a.k.a. workbook)
a ra_ref object
A ra_ref object can also store the name of a sheet and a file, though
these will often be NA. A cell reference in a formula can potentially
be qualified like this: [my_workbook.xlxs]Sheet1!R2C3. In Testoft
(2014), he creates an entirely separate class for this, a cell_ref,
which consists of a sheet- and file-ignorant ra_ref object and a sheet
reference (he doesn't allow formulas to refer to other files). I hope I
don't regret choosing a different path.
Spreadsheet Implementation Technology: Basics and Extensions Peter Sestoft MIT Press 2014
ra_ref()
#> <ra_ref>
#> row: 1 (abs)
#> col: 1 (abs)
#> R1C1
ra_ref(row_ref = 3, col_ref = 2)
#> <ra_ref>
#> row: 3 (abs)
#> col: 2 (abs)
#> R3C2
ra_ref(row_ref = 10, row_abs = FALSE, col_ref = 3, col_abs = TRUE)
#> <ra_ref>
#> row: 10 (rel)
#> col: 3 (abs)
#> R[10]C3
ra_ref(sheet = "a sheet")
#> <ra_ref>
#> row: 1 (abs)
#> col: 1 (abs)
#> sheet: 'a sheet'
#> 'a sheet'!R1C1