Returns the integer permutation that reorders the columns of a raw device
export into the column-major grid order every other pressR function
assumes. A reader applies it once:
pressure <- raw[, pr_channel_order(layout), drop = FALSE].
Arguments
- layout_or_map
A pr_layout built by
pr_layout_from_index_map()(orpr_layout_saddle_novel()), a channel index matrix as accepted bypr_layout_from_index_map(), or an integer vector that already is such a permutation.
Details
Element k of the result is the device channel that belongs in pressure
column k, where column k corresponds to which(layout$active)[k] —
the same column-major ordering used by pr_mask() and
.layout_build_coords().
See also
Other channel map functions:
pr_layout_from_index_map(),
pr_layout_saddle_novel()
Examples
pr_channel_order(rbind(c(2L, 1L), c(4L, 3L)))
#> [1] 2 4 1 3
ord <- pr_channel_order(pr_layout_saddle_novel())
length(ord)
#> [1] 256
ord[1:8]
#> [1] 16 32 48 64 80 96 112 128