Per-cell results are often stored only for a subset of a subset of the
rows of a sample (for example neighbourhood labels for the defined cells
among the counted cells). For records that refer to rows of the full
sample table, this returns the stored value, or missing where the row
lies outside the subsets.
Usage
LookupNestedRows(
data,
sample = "sample",
row = "row",
outer,
inner,
values = NULL,
samples,
outer_name = "counted",
inner_name = "defined_rows",
value_name = "cn",
missing = -1L,
base = 0L,
to = "value"
)Arguments
- data
Data frame of records with a sample and a row column.
- sample, row
Column names; rows are counted from
base.- outer
List (one entry per sample, in the order of
samples) of logical vectors over all rows, or lists holding such a vector namedouter_name.- inner
List of logical vectors over the outer rows, or lists holding one named
inner_nametogether with the valuesvalue_name.- values
Optional list of value vectors over the inner rows (default taken from
inner).- samples
Sample names matching the entries of the lists.
- outer_name, inner_name, value_name
Element names inside list entries.
- missing
Value for rows outside the subsets.
- base
Index of the first row (0 for arrays from Python).
- to
Name of the new column.