sortnum: sort numerically

Description Usage Arguments Value Author(s)

Description

sort a vector of words numerically, as opposed to alphanumerically. If your words contain a number, eg string1, string2, string3, ..., string10 then the standard sort would return string10, string1, string2, ... and converting to numeric would fail.

Usage

1
sortnum(x, decreasing = FALSE)

Arguments

x

character vector where each word may contain a number

decreasing

logical: Should the sort be increasing or decreasing? Not available for partial sorting.

Value

a sorted charcter vector

Author(s)

Mark Cowley, 2005-05-03


drmjc/mjcbase documentation built on May 15, 2019, 2:27 p.m.