ra_ref: ra_ref class

Description Usage Arguments Details Value Reference Examples

Description

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.

Usage

1
2
ra_ref(row_ref = 1L, row_abs = TRUE, col_ref = 1L, col_abs = TRUE,
  sheet = NA_character_, file = NA_character_)

Arguments

row_ref

integer, row or row offset

row_abs

logical indicating whether row_ref is absolute or relative

col_ref

integer, column or column offset

col_abs

logical indicating whether col_ref is absolute or relative

sheet

the name of a sheet (a.k.a. worksheet or tab)

file

the name of a file (a.k.a. workbook)

Details

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.

Value

a ra_ref object

Reference

Spreadsheet Implementation Technology: Basics and Extensions Peter Sestoft MIT Press 2014

Examples

1
2
3
4
ra_ref()
ra_ref(row_ref = 3, col_ref = 2)
ra_ref(row_ref = 10, row_abs = FALSE, col_ref = 3, col_abs = TRUE)
ra_ref(sheet = "a sheet")

Example output

<ra_ref>
   row: 1 (abs)
   col: 1 (abs)
 R1C1
<ra_ref>
   row: 3 (abs)
   col: 2 (abs)
 R3C2
<ra_ref>
   row: 10 (rel)
   col: 3 (abs)
 R[10]C3
<ra_ref>
   row: 1 (abs)
   col: 1 (abs)
 sheet: 'a sheet'
 'a sheet'!R1C1

cellranger documentation built on May 2, 2019, 11:26 a.m.