[R-sig-Geo] mkLookup

Michael Sumner mdsumner at utas.edu.au
Thu Jun 26 17:13:46 CEST 2008


How about this?

library(tripEstimation)
img <- list(x = 1:nrow(volcano), y = 1:ncol(volcano), z = volcano > 130 
& volcano < 155)
pts <- cbind(rnorm(100, 50, 10), rnorm(100, 30, 8))
image(img)
points(pts, cex = 0.5)

lookup <- mkLookup(img)
ok <- lookup(pts)
text(pts, lab = substr(as.character(ok), 1, 1))

This is a simple, one time-step lookup function - you can pack these 
binary masks (using "bits<-") compactly using integer arrays so you can 
store long time series of masks, and this lookup function will extract 
them as needed with bits() with the by.segment argument.

(None of this is terribly user friendly or easy to explain quickly I'm 
afraid, as it's applied to fairly specific location estimation routines 
that few people use).

I'll try to address some of your other questions, but I'd suggest 
keeping this conversation in R-sig-geo as many others here have more 
experience to offer.

Cheers, Mike.


LOUZAO wrote:
> Hello again Mike,
>
> Could you send me a code example of the following function?
>
> mkLookup {tripEstimation}
>
> Thanks
> matie louzao
>
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG. 
> Version: 8.0.101 / Virus Database: 270.4.1/1519 - Release Date: 6/25/2008 4:13 PM
>




More information about the R-sig-Geo mailing list