From I could understand, this packages forces "positive-definiteness" on an existing matrix. I could generate the matrices using an uniform distribution (as far as I could see, this is the standard method) and then force it to be positive-definite using this.
I guess it depends on your simulation which covariance matrices you need. If you assume that your variables are normally distributed, you should draw the covariance matrices from a Wishart distribution. You can do this in software packages like Mathematica or R. Alternatively, you can draw a given number of individuals from a multivariate normal distribution and compute their covariance matrix. Either way, the covariance matrices are positive-definite.
@Phillipp Could I impose some restriction to the structure of a matrix drawn from a Wishart distribution? I would like to define ranges of covariances for some blocks of variables to generate a complex pattern of covariance.
Yes, you can choose a certain "scale matrix", that's sort of the true population covariance matrix around which you sample your covariance matrices. Alternatively, you could come up with a specific factor model and create covariance matrices from that, e.g., by adding up outer products of the vectors of factor loadings (see ,e.g., my 2007 paper with Bookstein in Systematic Biology).
The rWishart() R function states that the scale matrix should be positive definite. If that is the case, I come back to the initial problem.
I don't want to use other methods, such as factor models procedure, because I want to be able to chance the covariance structure directly on the matrix, so that I have some kind of correspondence between an original matrix and the simulated one. As for sampling, I would like to investigate sampling error independently.
I could produce a "theoretical" matrix, force it to be positive definite (using John's suggestion) and then use it to produce random matrices with rWishart. Is this sound?
Yes, that's possible. But its still better to produce a positive-definite covariance matrix in a principled way from some model. Also, adding some multiple of the identity matrix (representing variance due to independent measurement error and noise) to a symmetric covariance matrix usually makes the matrix positive-defeinite.