Re: [R] Odp: Loop overwrite and data output problems

2010-03-17 Thread RCulloch
Hi Petr, Thanks again!!! model is a list. So your suggestion: mod <- matrix(NA, 1000, ncols) doesn't work. I thought that do.call and rbind would be the best for these data? Cheers, Ross -- View this message in context: http://n4.nabble.com/Loop-overwrite-and-data-output-problems-tp1570593p

Re: [R] Odp: Loop overwrite and data output problems

2010-03-10 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 10.03.2010 15:37:00: > > Hi Petr, > > Thanks again for your post the problem is now solved - thank you so much for > trying and trying to get this to work. > > So the final script that actually worked was: > > ##ALL SUBSET DATA > > #Create vector t

Re: [R] Odp: Loop overwrite and data output problems

2010-03-10 Thread RCulloch
Hi Petr, Thanks again for your post the problem is now solved - thank you so much for trying and trying to get this to work. So the final script that actually worked was: ##ALL SUBSET DATA #Create vector to put data in mod <- vector(1000,mode="list") #first order your data according to ID2 da

Re: [R] Odp: Loop overwrite and data output problems

2010-03-03 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 01.03.2010 16:36:27: > > Hi Petr, > > Thanks again for trying again with these data, I really appreciate it. > > Your script works perfectly, but the problem I'm having is how to store the > model results so after your script I would do: > >

Re: [R] Odp: Loop overwrite and data output problems

2010-03-01 Thread RCulloch
Hi Petr, Thanks again for trying again with these data, I really appreciate it. Your script works perfectly, but the problem I'm having is how to store the model results so after your script I would do: m1.R<-glm(cbind(res$BEH_T, res$BEH_F) ~ res$SITE + res$YEAR + res$PRECIP_MM

Re: [R] Odp: Loop overwrite and data output problems

2010-03-01 Thread Petr PIKAL
Hi I finally managed to get your data from CRAN help list Here is slightly modified solutions # just for initiation value<- matrix(NA, 98, 10) # slower way rad <- nrow(data) for( i in 1:10) { # sampling row indices ss <- sample(1:rad) # ordering data according to sampled row indices Sample

Re: [R] Odp: Loop overwrite and data output problems

2010-03-01 Thread Petr PIKAL
The data you put before was just those 98 rows. > data=read.table("clipboard", header=T) > data$ID2 [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 [26] 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 [51] 51 52 53 54 55 56 57 58 59 60 6

Re: [R] Odp: Loop overwrite and data output problems

2010-03-01 Thread RCulloch
Hi Pter, No doubt! I have put a very short form of the data set on the email - it is basically 2 data points from each individual, which should be enough to get an idea of where I'm going wrong.hopefully! I can send this as a .csv if you prefer? Cheers, Ross SITE_NAME SITEYEAR

Re: [R] Odp: Loop overwrite and data output problems

2010-03-01 Thread Petr PIKAL
Hi again I believe you are fishing a wrong pond. r-help-boun...@r-project.org napsal dne 01.03.2010 11:46:12: > > Hi Petr, > > Thank you for your post - I really appreciate you taking the time over my > problem. > > Apologies for not posting more data, it is just that the data set is rathe

Re: [R] Odp: Loop overwrite and data output problems

2010-03-01 Thread RCulloch
Hi Petr, Thank you for your post - I really appreciate you taking the time over my problem. Apologies for not posting more data, it is just that the data set is rather large, and I don't like posting the whole thing on the website for that reason. I have managed to random sample the 98 indivi

[R] Odp: Loop overwrite and data output problems

2010-02-26 Thread Petr PIKAL
Hi I am bit confused what you want to achieve. As I can not reproduce code without your data I just guess. If I understand you want to select from all your data randomly 98 values for 98 animals (one for each animal). I presume your id2 is sorted. One option # make sorted ids id2<-sample(1:5