Skip to content

Commit

Permalink
Create Advanced_raster_histogram.rsx
Browse files Browse the repository at this point in the history
  • Loading branch information
fsdias committed Nov 19, 2013
1 parent a0b5e94 commit fb08949
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions python/plugins/processing/r/scripts/Advanced_raster_histogram.rsx
@@ -0,0 +1,20 @@
##Layer=raster
##Raster processing=group
##Dens_or_Hist=string Hist
##showplots
library(rpanel)
library(rasterVis)
str <- Dens_or_Hist
if (str !='Dens' & str != 'Hist'){
rp.messagebox('you must enter "Dens" or "Hist"', title = 'oops!')
} else {
if (nbands(Layer) == 1) {
Layer <- as.matrix(Layer)
Layer <- raster(Layer)
}
if (str == 'Dens') {
densityplot(Layer)
} else if (str == 'Hist') {
histogram(Layer)
}
}

0 comments on commit fb08949

Please sign in to comment.