# NOT RUN {
# Load some pivoted data
(x <- purpose$`NNW WNW`)
# Make a tidy representation
cells <- tidy_table(x)
cells <- cells[!is.na(cells$chr), ] # Introduce 'holes' in the data
# Select a particular cell
cell <- cells[which(cells$row == 3 & cells$col == 3), ]
# Extend the selection downwards, stopping before the NA.
extend_S(cell, cells, boundary = ~ is.na(chr))
# Extend the selection right, up to and including the fifth column.
extend_E(cell, cells, boundary = ~ col == 5, include = TRUE)
# Extend the selection beyond the existing cells
extend_E(cell, cells, 15)
# This doesn't work inside formulas, because it would mean testing the
# boundary formula on every possible cell in the given direction
# }
# NOT RUN {
extend_E(cell, cells, boundary = ~ col == 15)
# }
# NOT RUN {
cell <- cells[which(cells$row == 7 & cells$col %in% 1:2), ]
extend_N(cell, cells, boundary = ~ !is.na(chr), edge = TRUE)
# }
Run the code above in your browser using DataLab