Skip to content
Permalink
Browse files

Create Advanced_raster_histogram.rsx

  • Loading branch information
fsdias committed Nov 19, 2013
1 parent a0b5e94 commit fb08949319f9197be2ffb74707e091c52cc034d9
Showing with 20 additions and 0 deletions.
  1. +20 −0 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.
You can’t perform that action at this time.