centre.log: logs and rescales a numeric matrix

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

takes the log of a real valued matrix, removes any columns where there are less than three finite values, and scales the values to lie between zero and 1.

Usage

1
  centre.log(mat)

Arguments

mat

a numeric n by p matrix, with 0's and possibly with NAs

Details

No details

Value

a numeric matrix of dimension n by q < p containing values between 0 and 1

Note

intended to be used within the plots.index.corr function

Author(s)

Colin Millar

References

no references

See Also

plots.index.corr

Examples

1
2
3
4
5
6
7
8
## The function is currently defined as
function(mat)
{
  mat[mat<=0] <- NA
  mat <- log(mat)
  mat <- mat[,apply(mat,2,function(x) sum(!is.na(x))>2)]
  apply(mat,2,function(x) (x-min(x, na.rm=T))/diff(range(x,na.rm=T)))
  }

FRSstats documentation built on May 2, 2019, 5:18 p.m.