Re: [R] Difficult with round() function

2011-01-18 Thread Petr Savicky
On Mon, Jan 17, 2011 at 12:02:21PM -0800, Aaron Polhamus wrote: > Dear list, > > I'm writing a function to re-grid a data set from finer to coarser > resolutions in R as follows (I use this function with sapply/apply): > > gridResize <- function(startVec = stop("What's your input vector"), > to =

Re: [R] Difficult with round() function

2011-01-17 Thread Carl Witthoft
I believe you've fallen into one of the R FAQs, namely the difference between a float and an integer. There are probably much better ways to set up your 'before' and 'after' gridpoint references, but you could start out by replacing the offending line with positions <- which(round(benchmark