'o.type' tests for the mode, factor status and other classifications of an object.  'x' is the object to be tested.  

ARGUMENTS:

'variables = TRUE' only has an effect if 'x' is a dataframe.  In this case, 'variables = TRUE' causes 'o.type' to list the information about every variable in 'x'. 

'sorted = TRUE' causes the output to printed with the TRUE attributes first; otherwise the attributes are always printed in the same order. 'sorted = TRUE' has no effect if 'x' is a dataframe and 'variables = TRUE'.

Possible Object Types:  

'all.NA' = all elements are NA; 
'array' = is an array;
'char' = character vector or matrix; 
'd.frame' = is a dataframe; 
'factor' = is a factor; 
'fn' = is a function; 
'list' = is a list; 
'logical' = is logical; 
'matrix' = is a matrix; 
'NULL' = is null; 
'numeric' = is numeric; 
'scalar' = is a scalar; 
'zero' = has length zero.

Note that a factor is false for 'is.numeric' even though its mode is numeric (R-oddity).  Moreoever factors and string variables are false for 'is.vector' if they have any attributes other than names (which they typically have).

'ob.dir' is the path to the OpenBUGS program directory.  

'bugs.dir' is an obsolete name for the WinBUGS program directory.  It has been replaced by 'ob.dir' and 'wb.dir' - these refer to the program directories of OpenBUGS and WinBUGS, respectively.

'odds.to.p' converts odds to probability where Odds(X) = P(X)/(1 - P(X).

'on.jm.cmptr' is a boolean function.  It returns TRUE if R is running on one of JM's usual computers, and FALSE otherwise.  on.jm.cmptr() is used to enable special actions that are active when JM is working onone of his usual computers, and are inactive when working on any other computer.

'order.jm' takes a matrix or dataframe as input and returns that same matrix or dataframe with the rows reordered by a user-specified set of columns.  'order.jm' serves a purpose similar to the 'order' function except that the 'order' function requires a sequence of vectors as input, whereas 'order.jm' can take a matrix or dataframe as input.  E.g., if 'x.mat' is a matrix with six columns,

x.mat[order(x.mat[,1], x.mat[,2], x.mat[,3]), ] 

returns 'x.mat' reordered by columns 1, 2 and 3 (index advances fastest on the right).  However, the following produces an error message:

x.mat[order(x.mat[ , 1:3]), ]

because the index is a matrix and 'order' requires a sequence of vectors to define the index.  We can accomplish the reordering with:

order.jm(x = x.mat, index = 1:3)

ARGUMENTS

'x' = a matrix or dataframe

'index' = a specification of columns, either numerically (e.g., 1:3) or in terms of column labels, e.g., 'c("AA", "BB", "CC")' assuming that these are column labels for 'x'.  The indexing columns advance fastest from the right, e.g., 'c("AA", "BB", "CC")' sorts 'x' on column 'CC' within tied levels of 'BB', and 'BB' within tied levels of 'AA'.