Reorder the measurement dimensions to match the order for display
my_reorder(disp_order, raw_nm)
disp_order
: The vector of names to be displayed (order matters)raw_nm
: The vector of names from raw measurements (order matters)A permuted vector from 1 to length(raw_nm)
. For example, if its first element is 3, it means that the 3rd pathogen in raw_nm
should be arranged to the first in the raw measurements.
disp_order <- c("B","E","D","C","F","A") raw_nm <- c("C","A","E") my_reorder(disp_order,raw_nm)
Useful links