Re: [R] :HELP

From: Dennis Murphy <djmuser_at_gmail.com>
Date: Sun, 03 Apr 2011 10:52:47 -0700

Hi:

Is this what you're after?

x <- matrix(1:10, nrow = 2, byrow = TRUE) rowSums(x[, 1:3])

HTH,
Dennis

PS: This list expects submissions to be in text, not HTML. See the Posting Guide, please.

On Sun, Apr 3, 2011 at 6:10 AM, mustafabinar <mustafa_binar_at_mynet.com>wrote:

> Hello,
> &nbsp;
> I want to sum first three terms of each column of matrix.
> But I don't calculate with "apply" function.
> &nbsp;
> skwkrt&lt;-function(N=10000,mu=0,sigma=1,n=100,
> nboot=1000,alpha=0.05){
> x&lt;-rnorm(N,mu,sigma)#population
> samplex&lt;-matrix(sample(x,n*nboot,replace=T),nrow=nboot)
> #...
> }
> &nbsp;
> is that: suppose a is a 5x2 matrix.
> &nbsp;a={1,2,3,4,5
> 6,7,8,9,10}
> &nbsp;
> I want to sum first three terms.
> sm[1]=1+2+3
> sm[2]=6+7+8
> But I don't calculate. please help me!!!
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org 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]]



R-help_at_r-project.org 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 Sun 03 Apr 2011 - 17:55:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 03 Apr 2011 - 18:40:27 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.

list of date sections of archive