Re: [R] Subtracting rows by id

2011-05-25 Thread Sara Maxwell
That worked perfectly. Thank you Dennis - I very much appreciate the help! Sara Maxwell, PhD, Postdoctoral Fellow Marine Conservation Institute University of California Santa Cruz Long Marine Laboratory 100 Shaffer Road Santa Cruz CA 95060 USA +1 206 355 3249 sara.maxw...@marine

[R] Subtracting rows by id

2011-05-25 Thread Sara Maxwell
Dear R users, I have two datasets: id1 <- c(rep(1,10), rep(2,10), rep(3,10)) value1 <- sample(1:100, 30, replace=TRUE) dataset1 <- cbind(id1,value1) id2 <- c(1,2,3) subtract.value <- c(1,3,5) dataset2 <- cbind(id2, subtract.value) I want to subtract the number of rows in the subtract.value that

Re: [R] Sorting values within a raster

2011-04-21 Thread Sara Maxwell
t makes sense. Any thoughts?? Many many thanks, Sara _ Sara M. Maxwell, Ph.D. On Apr 21, 2011, at 1:26 PM, David Winsemius wrote: On Apr 21, 2011, at 3:23 PM, Sara Maxwell wrote: I am working with a raster and want to take values assigned to each cell and so

[R] Sorting values within a raster

2011-04-21 Thread Sara Maxwell
there is a function that will do this automatically. Here is a sample dataset: library(raster) r <- raster(ncol=10, nrow=10) values(r) <- runif(ncell(r)) Many thanks for any input, Sara Maxwell --- Sara M. Maxwell, Ph.D. UC