Re: [R] Simple averaging question

2010-01-07 Thread Ista Zahn
Assuming the data frame is named "X": mean(X[c(5,8), "Time"]) See ?'[' for details. -Ista On Thu, Jan 7, 2010 at 1:20 PM, lse1986 wrote: > > I have the following data: > > http://i.imagehost.org/0650/Untitled2.jpg > > How would i average, say the 5th and the 8th entries? > Thanks in advance >

[R] Simple averaging question

2010-01-07 Thread lse1986
I have the following data: http://i.imagehost.org/0650/Untitled2.jpg How would i average, say the 5th and the 8th entries? Thanks in advance -- View this message in context: http://n4.nabble.com/Simple-averaging-question-tp1009086p1009086.html Sent from the R help mailing list archive at Nabbl

Re: [R] simple averaging question?

2007-11-01 Thread Jeff Miller
Moshe, Ted, & Chuck, All THREE approaches worked fine for me. Thank you! Sincerely, Jeff Miller Internal Virus Database is out-of-date. Checked by AVG Free Edition. 3:09 PM --- Begin Message --- Jeff Miller wrote: > Hi all, > Suppose I have a column vector of 600 measureme

Re: [R] simple averaging question?

2007-11-01 Thread Moshe Olshansky
If x is your vector, one possibility is: y <- matrix(x,nrow=60) z <- apply(y,2,mean) --- Jeff Miller <[EMAIL PROTECTED]> wrote: > Hi all, > > > > Suppose I have a column vector of 600 measurements > taken in 1s intervals. > > > > What I want is a new vector with the averages for > each m

Re: [R] simple averaging question?

2007-11-01 Thread Ted Harding
On 02-Nov-07 00:12:19, Jeff Miller wrote: > Hi all, > Suppose I have a column vector of 600 measurements taken > in 1s intervals. > > What I want is a new vector with the averages for each min > (so there would be 10 entries). > > Is there an efficient way to do this? I’ve been doing it > with a

Re: [R] simple averaging question?

2007-11-01 Thread Chuck Cleland
Jeff Miller wrote: > Hi all, > Suppose I have a column vector of 600 measurements taken in 1s intervals. > > What I want is a new vector with the averages for each min (so there would > be 10 entries). > > Is there an efficient way to do this? I’ve been doing it with a ‘for’ loop > but something

[R] simple averaging question?

2007-11-01 Thread Jeff Miller
Hi all, Suppose I have a column vector of 600 measurements taken in 1s intervals. What I want is a new vector with the averages for each min (so there would be 10 entries). Is there an efficient way to do this? I’ve been doing it with a ‘for’ loop but something tells me there is a simpl