View source: R/reorder-for-trellis-function.R
reorder.for.trellis | R Documentation |
Reorder a factor such that lattice plots come out in the correct numerical order. This function is useful when lattice plots are conditioned using factors with a mixture of text and numbers.
reorder.for.trellis(c("OSL01 - 5 s", "OSL02 - 200", "OSL03 - -100.3", "A03 - -100.3 s"))
x |
is the vector to be reordered |
method |
is the methiod to be used. Only "Nth-number" has been implemented |
absolute |
use absolute values. This avoids problems for text like temp-25-degC where 25 is probably 25 degC rather than -25 degC. |
N=1 |
means the first number (ignoring text etc.) N=2 means the second number (ignoring text etc.) |
reverse: |
If true the order is reversed. |
A reordered vector
Claus E. Andersen
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.