Re: [R] Summation in R

From: Petr Pikal <petr.pikal_at_precheza.cz>
Date: Tue 03 Oct 2006 - 09:01:27 GMT


Hi

you shall probably to be more specific

tj<-rnorm(5)
vj<-matrix(25,5,5)
sum(tj*vj)
[1] 149.2977

gives you an answer but maybe not the answer you want.

HTH
Petr

On 3 Oct 2006 at 8:58, Dina Said wrote:

Date sent:      	Tue, 03 Oct 2006 08:58:15 +0200
From:           	Dina Said <dinasaid@gmail.com>
To:             	r-help@stat.math.ethz.ch
Subject:        	[R] Summation in R

> Hello!
>
> Maybe this is a trivial question as I'm still a new baby in R but I
> wish that u will help me.
>
> I want to calculate the following
>
> U= sum (t_j*v_j)
>
> where t_j is a vector
> and v_j is the matrix
>
> Thanks
> Dina
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.

Petr Pikal
petr.pikal@precheza.cz



R-help@stat.math.ethz.ch 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. Received on Tue Oct 03 19:05:59 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 03 Oct 2006 - 10:30:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.