% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rarefy.r
\name{matrix_ops}
\alias{matrix_ops}
\alias{mtx_rarefy}
\alias{mtx_percent}
\alias{mtx_rescale}
\alias{rarefy_cols}
\alias{rescale_rows}
\alias{rescale_cols}
\title{Deprecated matrix transformations}
\usage{
mtx_rarefy(
  mtx,
  margin = 2L,
  depth = 0.1,
  n = NULL,
  seed = 0L,
  upsample = NULL,
  cpus = NULL
)

mtx_percent(mtx, margin = 2L)

mtx_rescale(mtx, margin = 2L, range = c(0, 1))

rarefy_cols(mtx, depth = 0.1, n = NULL, seed = 0L, cpus = NULL)

rescale_rows(mtx)

rescale_cols(mtx)
}
\arguments{
\item{mtx}{A numeric matrix or sparse matrix of counts.}

\item{margin}{Apply the transformation to the matrix's rows (\code{margin=1L})
or columns (\code{margin=2L}). Instead of \code{1L} and \code{2L}, you may also use
\code{'rows'} and \code{'cols'}.
Default: \code{2L} (column-wise, aka sample-wise for otu tables)}

\item{depth}{How many observations to keep per sample.}

\item{n}{Deprecated. The number of samples to keep. This argument is
ignored in the current version.}

\item{seed}{An integer seed for randomizing which observations to keep or
drop.}

\item{upsample}{If the count data is in percentages, provide an integer
value here to scale each sample's observations to integers that sum
to this value. Maps to \code{inflate} in the new syntax.}

\item{cpus}{The number of CPUs to use. Set to \code{NULL} to use all available,
or to \code{1} to disable parallel processing. Default: \code{NULL}}

\item{range}{When rescaling, what should the minimum and maximum values
be? Default: \code{c(0, 1)}}
}
\value{
A A numeric matrix or sparse matrix, depending on the input type,
with the same dimensions as \code{mtx}.
}
\description{
A collection of transformations that operate directly on matrices.
}
\examples{
    mtx <- matrix(1:12, ncol = 3, dimnames = list(paste0("OTU", 1:4), paste0("Sample", 1:3)))
    
    mtx
    
    suppressWarnings({
    
      mtx_rarefy(mtx)
      
      rarefy_cols(mtx)
      
      mtx_percent(mtx)
      
      mtx_rescale(mtx)
      
      rescale_rows(mtx)
      
      rescale_cols(mtx)
      
    })
    
}
