Re: [R] Loop overwrite and data output problems

2010-03-01 Thread RCulloch
HI Ivan, thanks for your post, I really appreciate the time you've taken over my problem! if (I==1) Sample.dat<-tmp[sample(1:max,1),] else { Sample.dat<-rbind(Sample.dat,tmp[sample(1:max,1),]) This part of the script works - I appreciate that it may not be the best option and I'm perhaps paper

Re: [R] Loop overwrite and data output problems

2010-02-26 Thread Ivan Calandra
Hi, Since I'm not an expert, I still have problems understanding when it's not my own work, but I have something that might help you. if (I==1) Sample.dat<-tmp[sample(1:max,1),] else { Sample.dat<-rbind(Sample.dat,tmp[sample(1:max,1),]) This part might not be the best. I would do something lik

[R] Loop overwrite and data output problems

2010-02-26 Thread RCulloch
Hello R users, I have been using R for a while now for basic stats but I'm now trying to get my head around looping scripts and in some places I am failing! I have a data set with c. 1200 data points on 98 individual animals with data on each row representing a daily measure and I am asking the