[R] add=TRUE or similar in spplot?

2011-10-21 Thread infochat
Dear Helper, I have a spatial lines data frame object 'spRiverDf'. The data frame consists of numbers {0,1,...,5}. And I have a vector 'colorS' of length 6 with different colours. If I make a plot with spplot I get a plot of the lines - colours depending on there number in the data frame colum

[R] vectorial search for elements with certain attributes

2011-05-19 Thread infochat
I have 2 vectors A and B. For each element of B I'd like to find the index of the next higher or equal element in A. And I'd like to store it effectiv. E.g.: A <- c(1,3,7,8,10) B <- c(5,8) result: 3, 4 I have a possibility but for long vectors it works not very effectiv: ans <- sapply(B, functi