% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{pairscale_median}
\alias{pairscale_median}
\title{Normalize matrix columns using their median differences}
\usage{
pairscale_median(
  x,
  clusters = NULL,
  min_value_count = 3L,
  niter_irls = 50L,
  na_mode = "check"
)
}
\arguments{
\item{x}{a numeric matrix that needs to be normalized. This variable is changed by reference! i.e. after this function, the original variable is updated}

\item{clusters}{an integer vector, of same length as \code{ncol(x)}, that describes cluster identifiers. These values must describe a continuous set of integers between 1 and the total number of unique clusters. For example, a 6 column matrix with 3 columns from some experimental condition followed by 3 columns from another condition would be \code{c(1,1,1, 2,2,2)}. To disable mode-between rescaling, i.e. treat the entire matrix as one cluster, provide a vector with ones.}

\item{min_value_count}{the minimum number of values overlapping between a pair of columns (if there are fewer overlapping values, respective rescaling is not computed)}

\item{niter_irls}{number of iterations to increase robustness (set to zero to disable)}

\item{na_mode}{string value that indicated how should we should deal with NA values (default). "check" = test if NA values are present and if so, remove these. "present" = you already know NA values are present so we can skip the check for NA values for efficiency. "unchecked" = you guarantee that there are no NA values in input, thus we'll use the fastest code paths that skip over any NA checks downstream; ONLY select this if you are sure there are no NA/NaN/Inf/-Inf values !}
}
\value{
a numeric vector that represents the normalization factors that were applied to each column in x. Note that x is updated by reference.
}
\description{
Pairwise normalization of columns in a matrix, using the median to define pairwise distances between columns
}
