Re: [R] Help with "apply"

From: M.Ribeiro <>
Date: Thu, 12 May 2011 20:39:20 -0700 (PDT)

Ok, I am sorry, I was building a reproducible example to post here and I made a mistake. Th second loop (in the variable k) updates ycorr. Therefore, it would be

ycorr <- rnorm(10)
Nindiv <- 10
x <-matrix(sample(c(0:2),50,re = T),10)
gtemp <- rnorm(10)
for (i in 1:Nindiv) {

        for (k in 1:ncol(x)) {
                ycorr[i] <- ycorr[i] - x[i,k]*gtemp[k]

View this message in context:
Sent from the R help mailing list archive at

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 13 May 2011 - 05:49:56 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

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 Fri 13 May 2011 - 06:50:06 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive