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

Convert two-dimensional data between ordinary (dense) matrix type, sparse representation, and a list of rows (or columns).

1 2 3 | ```
sparse2dense(x, dim=NULL)
dense2sparse(x)
matrix2list(x)
``` |

`x` |
object to convert ( |

`dim` |
number of rows and columns (length-two |

BIOM (Biological Observation Matrix) is a simple prescription for storing an annotated table of data. It may be described as a format, standard, or data structure.

The JSON (JavaScript Object Notation) standard for expressing general data objects as text is employed to define BIOM. Therefore the native form of BIOM data is structured text, conforming to the JSON specification in general and the BIOM specification in particular. Familiarity with BIOM is assumed here.

The S3 class codebiom and its methods facilitate analyses by expressing BIOM data as objects in the R environment. These manipulations of two-dimensional (matrix) data are sometimes handy when working with BIOM data. The sparse format used by BIOM is conventional, but see the reference for exact details.

All `names()`

and `dimnames()`

are removed.

`sparse2dense()`

and `dense2sparse()`

return a `matrix`

.

`matrix2list()`

returns a list of the rows of `x`

.

Like R these functions begin indices at 1, whereas BIOM counts from 0, so adjust if necessary.

Daniel T. Braithwaite

1 2 3 4 5 6 7 | ```
xx <- smat
xx[,1:2] <- xx[,1:2] + 1
sparse2dense (xx)
sparse2dense (xx, c(266,10))
matrix2list (dmat)
matrix2list (t(dmat))
``` |

BIOM.utils documentation built on May 29, 2017, 9:49 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.