Details
We use the eigenvalue method to transform $S$ into a positive
semidefinite covariance matrix (see e.g. Barndorff-Nielsen and Shephard, 2004, and Rousseeuw and Molenberghs, 1993). Let $\Gamma$ be the
orthogonal matrix consisting of the $p$ eigenvectors of $S$. Denote
$\lambda_1^+,\ldots,\lambda_p^+$ its $p$ eigenvalues, whereby the negative eigenvalues have been replaced by zeroes.
Under this approach, the positive semi-definite
projection of $S$ is $S^+ = \Gamma' \mbox{diag}(\lambda_1^+,\ldots,\lambda_p^+) \Gamma$.
If method="correlation", the eigenvalues of the correlation matrix corresponding to the matrix $S$ are
transformed. See Fan et al (2010).