[R] Named numeric vectors with the same value but different names return different results when used as thresholds for calculating true positives

2011-07-11 Thread Lyndon Estes
.8.0/x86_64 (64-bit) locale: [1] C/en_US.UTF-8/C/C/C/C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] rgdal_0.7-1 raster_1.8-39 sp_0.9-83 loaded via a namespace (and not attached): [1] grid_2.13.1 lattice_0.19

Re: [R] Named numeric vectors with the same value but different names return different results when used as thresholds for calculating true positives

2011-07-13 Thread Lyndon Estes
tch <- cbind(threshold, bins, tp, fp) ctch[1:20, ] Thanks again for your help. Cheers, Lyndon On Tue, Jul 12, 2011 at 5:09 AM, Eik Vettorazzi wrote: > Hi, > > Am 11.07.2011 22:57, schrieb Lyndon Estes: >> ctch[ctch$threshold == 3.5, ] >> # [1] threshold val       tp

Re: [R] Named numeric vectors with the same value but different names return different results when used as thresholds for calculating true positives

2011-07-13 Thread Lyndon Estes
. If you want to convert numbers to character > with the maximum possible precision, use format. > > ... which is exactly what you saw. > > -- Bert > > > On Wed, Jul 13, 2011 at 7:46 AM, Lyndon Estes wrote: >> Hello Eik, >> >> Thanks very much for your re

Re: [R] Named numeric vectors with the same value but different names return different results when used as thresholds for calculating true positives

2011-07-13 Thread Lyndon Estes
every single loop, but this is a >>> constant, so it is wasting time. Anyway, you get away even without >>> calculating this once, using >>> >>> tp[i]<-sum(x2>bins[i]) #indexing is not necessary, >>>                        #and 1-x2[j]<=tr == x2[j]>tr &g