Skip to content
Permalink
Browse files

Update Relative_distribution_(distance_covariate).rsx

  • Loading branch information
fsdias committed Nov 12, 2013
1 parent ee3870e commit a0b5e94a78ae3586c02f707b889c5d3f33e0e1ea
Showing with 25 additions and 42 deletions.
  1. +25 −42 python/plugins/processing/r/scripts/Relative_distribution_(distance_covariate).rsx
@@ -1,42 +1,25 @@
(dp0
S'ALG_DESC'
p1
VThis algorithm creates a graph that demonstrates the dependency of the intensity of the point process on the value of covariate. In this algorithm the covariate is the distance to the certain objects. The functionality is based on 'rhohat' function of the 'spatstat' package. \u000a\u000aR dependencies: library "maptools", "spatstat" and "rpanel".
p2
sS'ALG_CREATOR'
p3
VYury Ryabov\u000a2013\u000ariabovvv@gmail.com
p4
sS'Layer'
p5
VThe point process which distribution will be investigated.
p6
sS'Covariate_name'
p7
VThis field is mandatory. Enter the name of the covariate. It will appear at the graph.
p8
sS'Legend_position'
p9
VThis field defines the position of the legend at the graph. 'float' means that the legend will be placed at the position that would not overlap the graph itself (or will try at least). Other options are: 'topleft', 'topright', 'bottomleft', 'bottomright'.
p10
sS'x_label'
p11
VOptional label for the X axis. Note that units at the X axis will be the same as in the input layers.
p12
sS'RPLOTS'
p13
VThe empirical graph of the dependency of the intensity of the point process on the distance to the given objects.
p14
sS'ALG_HELP_CREATOR'
p15
VYury Ryabov\u000a2013\u000ariabovvv@gmail.com
p16
sS'Plot_name'
p17
VOptional plot name.
p18
sS'Covariate'
p19
VThe set of objects the distance from which will be calculated and used as a spatial covariate to the point process.
p20
s.
##Point pattern analysis=group
##Layer=vector
##Covariate=vector
##Covariate_name=string mandatory_covariate_name_(no_spaces)
##x_label=string
##Plot_name=string
##Legend_position=string float
library(spatstat)
library(maptools)
library(rpanel)
if (Covariate_name == "") {
rp.messagebox('Covariate name must not be emply!', title = 'oops!')}
else {
S <- Layer
SP <- as(S, "SpatialPoints")
P <- as(SP, "ppp")
r <- Covariate
rp <- as.psp(r)
rdist <- distfun(rp)
plot(rhohat(P, rdist, covname=Covariate_name), xlab= x_label,
legendpos = Legend_position,
legendargs=list(bg="transparent"),
main = Plot_name)
##showplots
}

0 comments on commit a0b5e94

Please sign in to comment.
You can’t perform that action at this time.