% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sparcc_matrix_rcpp.R
\name{sparcc_matrix_rcpp}
\alias{sparcc_matrix_rcpp}
\title{SparCC correlation matrix (Rcpp implementation)}
\usage{
sparcc_matrix_rcpp(data, iter = 20, inner_iter = 10, th = 0.1, nthreads = 0L)
}
\arguments{
\item{data}{Numeric matrix. Rows = samples, columns = taxa (ASVs/OTUs).}

\item{iter}{Integer. Number of outer iterations (Dirichlet resampling).
Default 20.}

\item{inner_iter}{Integer. Max inner iterations for pair exclusion.
Default 10.}

\item{th}{Numeric. Threshold for excluding highly correlated pairs.
Default 0.1.}

\item{nthreads}{Integer. Number of OpenMP threads for parallel \code{sparccinner}
(0 = use default). Only effective when OpenMP is available.}
}
\value{
Numeric matrix of taxa x taxa correlations (median across iterations).
}
\description{
Fast C++ implementation of SparCC for inferring correlations from
compositional count data. Input: samples x taxa matrix.
Output: taxa x taxa correlation matrix.
}
\examples{
\dontrun{
# data: samples x taxa count matrix
cor_mat <- sparcc_matrix_rcpp(asv_mat, iter = 20, inner_iter = 10, th = 0.1)
# With 4 threads (when OpenMP available)
cor_mat <- sparcc_matrix_rcpp(asv_mat, iter = 20, nthreads = 4)
}
}
