Topic: Utilities

Topic Description:

Basic R utilities used in many packages and functions, such as date and string manipulations, statistical distributions, geometry of lines and distances. The R package date is required for the two data functions.



File: utilities/utilities.r

View File Source Download File No help file available

Function: order.bynumber

Function Description: order.bynumber

Returns ordering of a character vector with any numbers coming first, in numeric order.

Function Arguments:

ArgumentDefault Value
x

Function Source:

order.bynumber=function(x)
{
options(warn=(-1))

num=(!is.na(as.numeric(x)))
numpart=as.character(sort(as.numeric(x[num])))
charpart=sort(x[!num])

options(warn=0)
return(match(c(numpart,charpart),x))
}