Re: [R] variance/mean

2009-03-23 Thread Wacek Kusnierczyk
(this post suggests a patch to the sources, so i allow myself to divert it to r-devel) Bert Gunter wrote: > x a numeric vector, matrix or data frame. > y NULL (default) or a vector, matrix or data frame with compatible > dimensions to x. The default is equivalent to y = x (but more efficient).

Re: [R] variance/mean

2009-03-23 Thread Bert Gunter
-project.org Subject: Re: [R] variance/mean rkevinbur...@charter.net wrote: > At the risk of appearing ignorant why is the folowing true? > > o <- cbind(rep(1,3),rep(2,3),rep(3,3)) > var(o) > [,1] [,2] [,3] > [1,]000 > [2,]000 > [3,]0

Re: [R] variance/mean

2009-03-22 Thread Wacek Kusnierczyk
Wacek Kusnierczyk wrote: > > when you apply var to a single matrix, it will compute covariances > between its columns rather than the overall variance: > > set.seed(0) > x = matrix(rnorm(4), 2, 2) > > var(x) > #[,1] [,2] > # [1,] 1.2629543 1.329799 >

Re: [R] variance/mean

2009-03-22 Thread Wacek Kusnierczyk
rkevinbur...@charter.net wrote: > At the risk of appearing ignorant why is the folowing true? > > o <- cbind(rep(1,3),rep(2,3),rep(3,3)) > var(o) > [,1] [,2] [,3] > [1,]000 > [2,]000 > [3,]000 > > and > > mean(o) > [1] 2 > > How do I get mean to return an ar

Re: [R] variance/mean

2009-03-22 Thread Ted Harding
On 22-Mar-09 08:17:29, rkevinbur...@charter.net wrote: > At the risk of appearing ignorant why is the folowing true? > > o <- cbind(rep(1,3),rep(2,3),rep(3,3)) > var(o) > [,1] [,2] [,3] > [1,]000 > [2,]000 > [3,]000 > > and > > mean(o) > [1] 2 > > How do