Trace the calculations of a cell recursively through all referenced cells
Source:R/trace_formula.R
trace_formula.RdArguments
- path
Filepath of an excel file
- cell.start
Character string of intiial cell in excel format. MUST include sheet name (e.g. "SPS!AS20", not "AS20")
- max.it
Maximum iterations; used as a failsafe to ensure function eventually in case of circular error. Defaults to 5000; increase if actual dependency network is likely to have more than 5000 nodes.
- verbose
Print cell addresses to console during tracing? Logical, defaults to
FALSE.- split.ranges
When encountering a reference that includes a cell range, trace backwards for all cells (TRUE) or just the first cell in the range (FALSE)? Logical, defaults to
FALSE. This option was added because sometimes formulas include sums across large ranges, ballooning the size of the resulting network. For building understanding, it is sometimes sufficient to trace only a representative from each referenced range, leading to smaller and simpler plots.
Value
"trace object" – list defining the dependency network.
$cellstibble summarizing each of the cells in the dependency network, starting with the
cell.start. Within this,$idis an index;$labelis the cell address;$formulais the formula in that cell if there is a formula, otherwise it is the contents of the cell,$contentsis the non-formula cell contents (i.e., if a formula is present,$contentswill be the results of the formula);$is.formulais a logical identifying if this cell contains a formula, or is purely a numeric / string / etc contents;$addresses.referencedis a character vector of all excel addresses in$formula, andsheetis the sheet associated with the current cell.$referencesis a tibble summarizing each of the edges of the dependency network – that is, all of the references in one cell to another.
$fromis the index of the cell that is referenced;$tois the index of the cell that is doing the referencing;$from_nameand$to_nameare the excel addresses of the same.$raw.tracinglist created during tracing that forms the backbone of
trace_formula. Intended for internal use;$cellsand$referencescontains the important results here.