Skip to content

Commit 7165e88

Browse files
committed
[processing] R improvements
This commit: Deletes Example scripts Replaces Example scripts with more up to date versions Adds general categories for r scripts: Basic statistics, Vector processing, Raster processing and Point pattern analysis adds help files to all r scripts Adds a groups of r scripts entitled Home range analysis, that includes Kernel href, LSCV Kernel, Minimum convex polygon, single linkage cluster analysis and characteristic hull method, using adehabitatHR() Adds the following R scripts contributed by Yury Ryabov ( riabovvv(at)gmail.com ): Advanced raster histogram, Monte carlo spatial randomness, Relative distribution (distance covariate), Relative distribution (raster covariate),
1 parent 371f9ba commit 7165e88

File tree

51 files changed

+752
-90
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+752
-90
lines changed

python/plugins/processing/r/scripts/Advanced_Raster_histogram.rsx

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
(dp0
2+
S'ALG_CREATOR'
3+
p1
4+
V
5+
p2
6+
sS'ALG_DESC'
7+
p3
8+
VThis algorithm generates a histogram or a density plot for the given raster. NOTE that you should not use this algorithm to process large rasters.\u000a\u000aR dependencies: rpanel, rasterVis. If you are using Linux you need to install "tcktk" and "BWidget" from your package master.
9+
p4
10+
sS'Dens_or_Hist'
11+
p5
12+
VUse 'hist' to produce histogram of the raster values (separate plots for each band) and 'dens' if you want to create a density plot (single plot for all bands).
13+
p6
14+
sS'RPLOTS'
15+
p7
16+
VRaster histogram.
17+
p8
18+
sS'Layer'
19+
p9
20+
VA single- or multi-band raster.
21+
p10
22+
s.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
##Home Range Analysis=group
2+
##Layer=vector
3+
##Field=Field Layer
4+
##Home_ranges=Output vector
5+
library(adehabitatHR)
6+
library(deldir)
7+
res <- CharHull(Layer[,Field])
8+
Home_ranges<-getverticeshr(res)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
(dp0
2+
S'ALG_DESC'
3+
p1
4+
VThis script computes the Characteristic Hull method that relies on the calculation of the Delaunay triangulation of the set of relocations. Then, the triangles are ordered according to their area (and not their perimeter). The smallest triangles correspond to the areas the most intensively used by the animals. It is then possible to derive the home range estimated for a given percentage level.\u000a\u000aR depencies: library "adehabitatHR" and "deldir".\u000a
5+
p2
6+
sS'Home_ranges'
7+
p3
8+
VThe home-range contours.
9+
p4
10+
sS'ALG_CREATOR'
11+
p5
12+
VFilipe S. Dias, filipesdias(at)gmail.com
13+
p6
14+
sS'Layer'
15+
p7
16+
VA layer containing the relocations of one or more animals
17+
p8
18+
sS'Field'
19+
p9
20+
VThe field containing the unique indentifer for each animal (type "string").
21+
p10
22+
sS'ALG_HELP_CREATOR'
23+
p11
24+
VFilipe S. Dias, filipesdias(at)gmail.com
25+
p12
26+
s.

python/plugins/processing/r/scripts/Compute_Ripley-Rasson_spatial_domain.rsx

Lines changed: 0 additions & 9 deletions
This file was deleted.

python/plugins/processing/r/scripts/Create_random_sampling_grid.rsx

Lines changed: 0 additions & 6 deletions
This file was deleted.

python/plugins/processing/r/scripts/Create_regular_sampling_grid.rsx

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
##Vector processing=group
2+
##Layer = raster
3+
##showplots
4+
hist(as.matrix(Layer),main="Histogram",xlab="Layer")
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
(dp0
2+
S'ALG_CREATOR'
3+
p1
4+
VFilipe S. Dias
5+
p2
6+
sS'Field'
7+
p3
8+
VA numeric field.
9+
p4
10+
sS'ALG_DESC'
11+
p5
12+
VThis tool creates a dotplot of the input numeric field using the function dotchart().\u000a
13+
p6
14+
sS'Layer'
15+
p7
16+
VA vector layer with a numeric field.
17+
p8
18+
sS'ALG_HELP_CREATOR'
19+
p9
20+
VFilipe S. Dias
21+
p10
22+
s.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
##Point pattern analysis=group
2+
##Layer=vector
3+
##Nsim=number 10
4+
##showplots
5+
library("maptools")
6+
library("spatstat")
7+
ppp=as(as(Layer, "SpatialPoints"),"ppp")
8+
plot(envelope(ppp, Fest, nsim=Nsim))

0 commit comments

Comments
 (0)