The help and its examples are very comprehensive here. The usage you cite shows exactly what you need to do

From: Alaios [mailto:

[hidden email]]

Sent: Thursday, November 18, 2010 1:30 PM

To: Doran, Harold

Subject: RE: [R] Sample covariance matrix in R

Checked that

Usage

covr(x, y = NULL, na.rm = FALSE, use)

as you can see expectes two inputs ,,, or one with two columns..

I also found intresting this

The denominator n - 1 is used which gives an unbiased estimator of the (co)variance for i.i.d. observations\

but I do not know how to use this inside the cov to get wjhat I am lloking for.

Regards

Alex

--- On Thu, 11/18/10, Doran, Harold <

[hidden email]> wrote:

From: Doran, Harold <

[hidden email]>

Subject: RE: [R] Sample covariance matrix in R

To: "Alaios" <

[hidden email]>, "Rhelp" <

[hidden email]>

Date: Thursday, November 18, 2010, 6:26 PM

Alex:

?cov

> -----Original Message-----

> From:

[hidden email]</mc/compose?to=

[hidden email]> [mailto:

[hidden email]</mc/compose?to=

[hidden email]>] On

> Behalf Of Alaios

> Sent: Thursday, November 18, 2010 12:54 PM

> To: Rhelp

> Subject: [R] Sample covariance matrix in R

>

> Hello everyone.

> I would like to find the sample covariance matrix using R.

>

> So far I read on the wikipedia what a sample_covariance is

>

http://en.wikipedia.org/wiki/Sample_covariance>

> according to wikipedia one vector is enough to calculate the sample covariance

> matrix.

> In R I tried cov(myvector) and I get the reply that I need to pass either two

> argument or one matrix with x,y values .

>

> How can I find the sample covariance matrix?

>

> Best Regards

> Alex

>

>

>

>

>

> [[alternative HTML version deleted]]

>

> ______________________________________________

>

[hidden email]</mc/compose?to=

[hidden email]> mailing list

>

https://stat.ethz.ch/mailman/listinfo/r-help> PLEASE do read the posting guide

http://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.

[[alternative HTML version deleted]]

______________________________________________

[hidden email] mailing list

https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide

http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.