gjamDeZero: Compress (de-zero) gjam data

View source: R/gjamDeZero.r

gjamDeZeroR Documentation

Compress (de-zero) gjam data

Description

Returns a de-zeroed (sparse matrix) version of matrix ymat with objects needed to re-zero it.

Usage

  gjamDeZero(ymat)

Arguments

ymat

n by S response matrix

Details

Many abundance data sets are mostly zeros. gjamDeZero extacts non-zero elements for storage.

Value

Returns a list containing the de-zeroed ymat as a vector yvec.

yvec

non-zero elements of ymat

n

no. rows of ymat

S

no. cols of ymat

index

index for non-zeros

ynames

column names of ymat

Author(s)

James S Clark, jimclark@duke.edu

References

Clark, J.S., D. Nemergut, B. Seyednasrollah, P. Turner, and S. Zhang. 2016. Generalized joint attribute modeling for biodiversity analysis: Median-zero, multivariate, multifarious data. Ecological Monographs 87, 34-56.

See Also

gjamReZero to recover ymat

browseVignettes('gjam')

website 'http://sites.nicholas.duke.edu/clarklab/code/'.

Examples

## Not run: 
library(repmis)
source_data("https://github.com/jimclarkatduke/gjam/blob/master/fungEnd.RData?raw=True")

ymat <- gjamReZero(fungEnd$yDeZero)  # OTUs stored without zeros
length(fungEnd$yDeZero$yvec)         # size of stored version
length(ymat)                         # full size
yDeZero <- gjamDeZero(ymat)
length(yDeZero$yvec)                 # recover de-zeroed vector

## End(Not run)

gjam documentation built on May 24, 2022, 1:06 a.m.