[R] outer problem
thomas at biostat.washington.edu
Mon Jun 19 19:52:37 CEST 2000
On Mon, 19 Jun 2000, Erich Neuwirth wrote:
> why does teh following code not work?
> from what i know
> covmat(a) should give the covariance matrix of a, but it gives a matrix
> constant elements.
> mycov(a,1,2) ans simlar calls are doing the right thing.
> so somehow i am misunderstanding outer here.
You're misunderstanding outer().
outer(x,y,f) does just one call to f with arguments created by stacking x
and y together in the right way, so f has to be vectorised.
In any case, var(X) returns the covariance matrix of X, much more
Assistant Professor, Biostatistics
University of Washington, Seattle
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
More information about the R-help