[R-sig-Geo] arithmetic with layers from a raster stack/brick

2013-02-28 Thread aniruddha ghosh
Dear List, I'm trying to perform some arithmetic operation with layers of a raster object. What I'm trying is >require(raster) >r<- raster(nrows=2, ncols=2) >r[]<-1:ncell(r) >s<-stack(r,r) >names(s)<-c("a","b") # now I want to add the layers of the raster "r" using their corresponding names,i.e.

Re: [R-sig-Geo] create new raster from multiple input raster following logical conditions?

2012-10-18 Thread aniruddha ghosh
1 or 2 or 0. and the product r3 > will be 1 or 2 or 0 > > On Oct 17, 2012 11:55 AM, "aniruddha ghosh" wrote: >> >> Dear List, >> I have two raster layers (r1 and r2) and the cells have values ranging 1 to >> 10. I want to create a new raster layer from thes

[R-sig-Geo] create new raster from multiple input raster following logical conditions?

2012-10-17 Thread aniruddha ghosh
Dear List, I have two raster layers (r1 and r2) and the cells have values ranging 1 to 10. I want to create a new raster layer from these two with different conditions like: 1) if r1==1 and r2==1, then r3 should be 1 2) if r1==1 and r2==2, then r3 should be 2 else 0 etc With the following example:

Re: [R-sig-Geo] Error: NA/NaN/Inf in foreign function call (arg 7) while using Predict function with Raster

2012-10-04 Thread aniruddha ghosh
neLength = 5, > trControl = trainControl(method = "repeatedcv", repeats = 5, verboseIter = > FALSE), metric = "Kappa") > > >> logo[2:10,] <- NA >> r1 <- predict(logo, rfFit) >> >> logo[2:10,] <- Inf >> r2 <- predict(logo, rfF

[R-sig-Geo] Error: NA/NaN/Inf in foreign function call (arg 7) while using Predict function with Raster

2012-10-03 Thread aniruddha ghosh
Dear List, I'm trying to classify a multiband raster with point shapefiles as training data. I used the following: vec<-readOGR(".","training") raster<-stack("test.tif") #it contains around 10 pixels and 240 layers outImage<-"classified.tif" #then extract the training values train<-extract(ra

[R-sig-Geo] analysis on .dbf file instead of .shp

2012-06-11 Thread aniruddha ghosh
attribute to this .dbf file? I'm using the .dbf file beacuse it is allowing me to apply diiferent methods from different packages for prediction which I couldn't apply to the .shp files due to my limited knowledge in using R! Thanks, Aniruddha Ghosh ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo