reorder.for.trellis: Reorder a factor such that lattice plots come out in the...

View source: R/reorder-for-trellis-function.R

reorder.for.trellisR Documentation

Reorder a factor such that lattice plots come out in the correct numerical order.

Description

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.

Usage

reorder.for.trellis(c("OSL01 - 5 s", "OSL02 - 200", "OSL03 - -100.3", "A03 - -100.3 s"))

Arguments

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.

Value

A reordered vector

Author(s)

Claus E. Andersen


claus-e-andersen/clanLattice documentation built on June 2, 2024, 6:23 a.m.