iotable {lazy.tools}R Documentation

Inside-Out table

Description

Inside-Out table

Usage

iotable(
  x,
  id = NULL,
  var = NULL,
  rank = 0,
  abs = 0,
  descending = 1,
  dec = NULL,
  mark = "-",
  print = 1
)

Arguments

x

Input vector matrix

id

id to be used instead of rownames(x).

var

sas-like abbreviated list of variables to be used.

rank

= 1 to retrun the rank in stead of the row name.

abs

= 1 to use the absolute value of x to sort.

descending

= 0 to sort ascendingly.

dec

a vector indicating if the sort is descending order for each varaible.

mark

A character to mark the negative numbers.

print

= 1 to print the result.

Details

This function sort the id according to the magnitude of each variable.
When rank = 0 and abs = 1, those names corresponding to
the negative values will be marked by - sign.

Value

A vector or matrix of the same size as x.

Examples

data <- matrix(c(c(2,1,4,5,3),1:5),,2)
rownames(data) <- paste("r",1:5,sep="")
colnames(data) <- paste("v",1:2,sep="")
data[4,2]=-9
iotable( data, descending=1, print=0 )
iotable( data, descending=1, abs=1, print=0 )


[Package lazy.tools version 0.1.6 ]