-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtools.xml
458 lines (458 loc) · 25.3 KB
/
tools.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
<?xml version="1.0"?>
<manageRTools>
<RTool name="Insert R commands" query="|1|">
<Parameter label="R commands:" type="textEdit" default="ls()" notnull="true"/>
<Parameter label="help" type="helpString" default="
<h4>Insert R commands help</h4>
This is a simple test plugin that allows the user to input R commands into a simple text editor,
and run the commands in the console.
The tool does not require any specific R libraries. The
default command (<tt>ls()</tt>), displays all variables and functions in the current
R environment." notnull="true"/>
</RTool>
<RTool name="Load OGR data" category= "Spatial operations" query=
"|2| <- local({

require(rgdal)

readOGR('|1|', '|2|', verbose = TRUE, p4s=NULL, drop_unsupported_fields=FALSE,

input_field_name_encoding=NULL, pointDropZ=FALSE, dropNULLGeometries=TRUE)

})
">
<Parameter label="Data source name:" type="lineEdit" default="/path/to/layer.shp" notnull="true"/>
<Parameter label="Layer name:" type="lineEdit" default="layer" notnull="true"/>
<Parameter label="help" type="helpString" default="topic:readOGR" notnull="true"/>
</RTool>
<RTool name="Write OGR data" category= "Spatial operations" query=
"local({

require(rgdal)

writeOGR(|1|, '|2|', |3|, |4|, dataset_options=NULL, layer_options=NULL, verbose=TRUE)

})
">
<Parameter label="Input layer:" type="spComboBox" default=
"SpatialPointsDataFrame;SpatialLinesDataFrame;SpatialPolygonsDataFrame" notnull="true"/>
<Parameter label="Output path:" type="lineEdit" default="/output/path/layer.shp" notnull="true"/>
<Parameter label="Output layer name:" type="lineEdit" default="layer" notnull="true"/>
<Parameter label="Driver name:" type="comboBox" default=
"ESRI Shapefile;GML;KML;MapInfo File;CSV;PostgreSQL;SQLite;ODBC;MySQL;GPX;GMT;GeoJSON" notnull="true"/>
<Parameter label="help" type="helpString" default="topic:writeOGR" notnull="true"/>
</RTool>
<RTool name="Load GDAL data" category= "Spatial operations" query=
"|2| <- local({

require(rgdal)

readGDAL('|1|')

})
">
<Parameter label="Data source name:" type="lineEdit" default="/path/to/grid.tiff" notnull="true"/>
<Parameter label="Layer name:" type="lineEdit" default="layer" notnull="true"/>
<Parameter label="help" type="helpString" default="topic:readGDAL" notnull="true"/>
</RTool>
<RTool name="Write GDAL data" category= "Spatial operations" query=
"local({

require(rgdal)

writeGDAL(|1|, '|2|', drivername='|3|', type='Float32', mvFlag=|4|, copy_drivername='|3|')

})
">
<Parameter label="Input layer:" type="spComboBox" default="SpatialGridDataFrame;SpatialPixelDataFrame" notnull="true"/>
<Parameter label="Output path:" type="lineEdit" default="/path/to/grid.tiff" notnull="true"/>
<Parameter label="Driver name:" type="comboBox" default=
"GTiff;VRT;PNG;JPEG;EHdr;ENVI" notnull="true"/>
<Parameter label="Missing value flag:" type="lineEdit" default="NA" notnull="true"/>
<Parameter label="help" type="helpString" default="topic:writeGDAL" notnull="true"/>
</RTool>
<RTool name="Voronoi polygons" category= "Spatial operations" query=
"|2| <- local({

require(deldir)

crds <- |1|@coords

z <- deldir(crds[,1], crds[,2])

w <- tile.list(z)

polys <- vector(mode='list', length=length(w))

require(sp)

for (i in seq(along=polys)) {

pcrds <- cbind(w[[i]]$x, w[[i]]$y)

pcrds <- rbind(pcrds, pcrds[1,])

polys[[i]] <- Polygons(list(Polygon(pcrds)), ID=as.character(i))

}

SP <- SpatialPolygons(polys)

areas <- sapply(slot(SP, 'polygons'), function(x) sapply(slot(x,'Polygons'), slot, 'area'))

SpatialPolygonsDataFrame(SP, data=data.frame(x=crds[,1], y=crds[,2], row.names=sapply(slot(SP,
'polygons'), function(x) slot(x, 'ID')), area=areas))

})
">
<Parameter label="Point layer:" type="spComboBox" default="SpatialPointsDataFrame" notnull="true"/>
<Parameter label="Output layer:" type="lineEdit" default="voronoi" notnull="true"/>
<Parameter label="help" type="helpString" default="
<h4>Voronoi polygons help</h4>
Calculate the Voronoi or Thiessen tesselation of an input SpatialPointsDataFrame.

Uses the <tt>sp</tt> library to get the coordinates of
the input SpatialPointsDataFrame, and creates a bounded Voronoi tesselation using the <tt>deldir</tt>
and <tt>tile.list</tt> functions of the <tt>deldir</tt> library. Output is a
SpatialPolygonsDataFrame, with the X and Y coordinates of the input points as attributes.

After running this plugin, you can acheive the same results by using the <tt>voronoipolygons()</tt>
function in the console." notnull="true"/>
</RTool>
<RTool name="Polygon centroids" category= "Spatial operations" query=
"|2| <- local({

proj <- proj4string(|1|)

coords <- coordinates(|1|)

attrs <- |1|@data

centroids <- SpatialPointsDataFrame(coords=coords, 

data=attrs, proj4string=CRS(proj))

})">
<Parameter label="Polygon layer:" type="spComboBox" default="SpatialPolygonsDataFrame" notnull="true"/>
<Parameter label="Output layer:" type="lineEdit" default="centroids" notnull="true"/>
<Parameter label="help" type="helpString" default="
<h4>Polygon centoids help</h4>
Calculate the true centroids, or 'center of mass' for each polygon in an input SpatialPolygonsDataFrame.

Uses the <tt>sp</tt> library to get the coordinates of the input SpatialPolygonsDataFrame,
and creates a new SpatialPointsDataFrame consisting of the centroid coordinates or the polygons, with
the attributes of the input SpatialPolygonsDataFrame.

After running this plugin, you can acheive the same results by using the <tt>polygoncentroids()</tt>
function in the console." notnull="true"/>
</RTool>
<RTool name="Quick plot" category= "Plotting" query=
"local({

plot(|1|, type='|2|', main='|3|', sub='|4|', xlab='|5|',
ylab='|6|', bty='|7|', lab=c(|8|,|9|,7), las=|10|)

})">
<Parameter label="X values:" type="spComboBox" default="numeric;integer" notnull="true"/>
<Parameter label="Plot type:" type="comboBox" default=
"points;lines;both;overplotted;histogram;stair steps;no plotting" notnull="true"/>
<Parameter label="Main title:" type="lineEdit" default="Scatterplot" notnull="false"/>
<Parameter label="Sub title:" type="lineEdit" default="" notnull="false"/>
<Parameter label="X label:" type="lineEdit" default="X Axis" notnull="false"/>
<Parameter label="Y label:" type="lineEdit" default="Y Axis" notnull="false"/>
<Parameter label="Bounding box:" type="comboBox" default=
"outline;l-shape;7-shape;c-shape;u-shape;]-shape;none" notnull="true"/>
<Parameter label="X axis ticks:" type="lineEdit" default="5" notnull="true"/>
<Parameter label="Y axis ticks:" type="lineEdit" default="5" notnull="true"/>
<Parameter label="Axis labels:" type="comboBox" default="1;2;3;0" notnull="true"/>
<Parameter label="help" type="helpString" default="topic:plot" notnull="true"/>
</RTool>
<RTool name="Scatterplot" category= "Plotting" query=
"local({

plot(x=|1|, y=|2|, type='p', main='|3|', sub='|4|', xlab='|5|',
ylab='|6|', bty='|7|', lab=c(|8|,|9|,7), las=|10|, |11|)

if (|12|) {

tmp.fit <- lm(|2| ~ |1|)

abline(tmp.fit, lty='|13|')

}

})">
<Parameter label="X values:" type="spComboBox" default="numeric;integer" notnull="true"/>
<Parameter label="Y values:" type="spComboBox" default="numeric;integer" notnull="true"/>
<Parameter label="Main title:" type="lineEdit" default="Scatterplot" notnull="false"/>
<Parameter label="Sub title:" type="lineEdit" default="" notnull="false"/>
<Parameter label="X label:" type="lineEdit" default="X Axis" notnull="false"/>
<Parameter label="Y label:" type="lineEdit" default="Y Axis" notnull="false"/>
<Parameter label="Bounding box:" type="comboBox" default=
"outline;l-shape;7-shape;c-shape;u-shape;]-shape;none" notnull="true"/>
<Parameter label="X axis ticks:" type="lineEdit" default="5" notnull="true"/>
<Parameter label="Y axis ticks:" type="lineEdit" default="5" notnull="true"/>
<Parameter label="Axis labels:" type="comboBox" default="1;2;3;0" notnull="true"/>
<Parameter label="Additional parameters:" type="lineEdit" default="" notnull="false"/>
<Parameter label="Add trend line:" type="comboBox" default="FALSE;TRUE" notnull="true"/>
<Parameter label="Trend line style:" type="comboBox" default=
"solid;dashed;dotted;dotdash;longdash;twodash" notnull="true"/>
<Parameter label="help" type="helpString" default="topic:plot" notnull="true"/>
</RTool>
<RTool name="Histogram" category= "Plotting" query=
"local({

hist(|1|, breaks='|2|', main='|4|', sub='|5|', xlab='|6|', bty='|7|',
freq=ifelse('|3|'=='Frequency',TRUE,FALSE), |10|)

if (|8|) lines(density(|1|), lty='|9|')

})">
<Parameter label="Input values:" type="spComboBox" default="numeric;integer" notnull="true"/>
<Parameter label="Break calculation:" type="comboBox" default=
"Sturges;Scott;Freedman-Diaconis" notnull="true"/>
<Parameter label="Plot type:" type="comboBox" default="Frequency;Density" notnull="true"/>
<Parameter label="Main title:" type="lineEdit" default="Histogram" notnull="false"/>
<Parameter label="Sub title:" type="lineEdit" default="" notnull="false"/>
<Parameter label="X label:" type="lineEdit" default="X Axis" notnull="false"/>
<Parameter label="Bounding box:" type="comboBox" default=
"outline;l-shape;7-shape;c-shape;u-shape;]-shape;none" notnull="true"/>
<Parameter label="Add probability distribution:" type="comboBox" default="FALSE;TRUE" notnull="true"/>
<Parameter label="Line style:" type="comboBox" default=
"solid;dashed;dotted;dotdash;longdash;twodash" notnull="true"/>
<Parameter label="Additional parameters:" type="lineEdit" default="" notnull="false"/>
<Parameter label="help" type="helpString" default="topic:hist" notnull="true"/>
</RTool>
<RTool name="Box-plot" category= "Plotting" query=
"local({

boxplot(|1|, varwidth=|2|, notch=|3|, outline=|4|, horizontal=|5|,
main='|6|', sub='|7|', xlab='|8|', ylab='|9|')

})">
<Parameter label="Input data:" type="spComboBox" default="numeric;data.frame;integer" notnull="true"/>
<Parameter label="Use variable width boxes:" type="comboBox" default="FALSE;TRUE" notnull="true"/>
<Parameter label="Add box notches:" type="comboBox" default="FALSE;TRUE" notnull="true"/>
<Parameter label="Show outliers:" type="comboBox" default="TRUE;FALSE" notnull="true"/>
<Parameter label="Plot boxes horizontally:" type="comboBox" default="FALSE;TRUE" notnull="true"/>
<Parameter label="Main title:" type="lineEdit" default="Box-plot" notnull="false"/>
<Parameter label="Sub title:" type="lineEdit" default="" notnull="false"/>
<Parameter label="X label:" type="lineEdit" default="X Axis" notnull="false"/>
<Parameter label="Y label:" type="lineEdit" default="Y Axis" notnull="false"/>
<Parameter label="help" type="helpString" default="topic:boxplot" notnull="true"/>
</RTool>
<RTool name="Pie-chart" category= "Plotting" query=
"local({

pie(|1|, clockwise=|2|, main='|3|', sub='|4|', |5| )

})">
<Parameter label="Input data:" type="spComboBox" default="numeric;integer" notnull="true"/>
<Parameter label="Clockwise:" type="comboBox" default="FALSE;TRUE" notnull="true"/>
<Parameter label="Main title:" type="lineEdit" default="Pie-chart" notnull="false"/>
<Parameter label="Sub title:" type="lineEdit" default="" notnull="false"/>
<Parameter label="Additional parameters:" type="lineEdit" default="" notnull="false"/>
<Parameter label="help" type="helpString" default="topic:pie" notnull="true"/>
</RTool>
<RTool name="Bar-graph" category= "Plotting" query="
local({

barplot(|1|, horiz=|2|, main='|3|', sub='|4|', xlab='|5|', ylab='|6|', |7|)

})">
<Parameter label="Input data:" type="spComboBox" default="numeric;integer" notnull="true"/>
<Parameter label="Horizontal:" type="comboBox" default="FALSE;TRUE" notnull="true"/>
<Parameter label="Main title:" type="lineEdit" default="Bar-graph" notnull="false"/>
<Parameter label="Sub title:" type="lineEdit" default="" notnull="false"/>
<Parameter label="X label:" type="lineEdit" default="X Axis" notnull="false"/>
<Parameter label="Y label:" type="lineEdit" default="Y Axis" notnull="false"/>
<Parameter label="Additional parameters:" type="lineEdit" default="" notnull="false"/>
<Parameter label="help" type="helpString" default="topic:barplot" notnull="true"/>
</RTool>
<RTool name="Density plot" category= "Plotting" query="
local({

plot(density(|1|, bw='|2|', adjust=|3|, kern='|4|', n=|5|, na.rm=|6|),
main='|7|', sub='|8|', xlab='|9|', ylab='|10|', |11|)

if (|12|) rug(|1|, |13|, |14|, side=|15|)
})">
<Parameter label="Input data:" type="spComboBox" default="numeric;integer" notnull="true"/>
<Parameter label="Bandwidth:" type="comboBox" default="nrd0;nrd;ucv;bcv;SJ-ste;SJ-dpi" notnull="true"/>
<Parameter label="Bandwidth adjustment:" type="doubleSpinBox" default="1" notnull="true"/>
<Parameter label="Smoothing kernel:" type="comboBox" default=
"gaussian;rectangular;triangular;epanechnikov;biweight;cosine;optcosine" notnull="true"/>
<Parameter label="Resolution:" type="doubleSpinBox" default="512.00" notnull="true"/>
<Parameter label="Remove NA values:" type="comboBox" default="TRUE;FALSE" notnull="true"/>
<Parameter label="Main title:" type="lineEdit" default="Density plot" notnull="false"/>
<Parameter label="Sub title:" type="lineEdit" default="" notnull="false"/>
<Parameter label="X label:" type="lineEdit" default="X Axis" notnull="false"/>
<Parameter label="Y label:" type="lineEdit" default="Y Axis" notnull="false"/>
<Parameter label="Additional parameters:" type="lineEdit" default="" notnull="false"/>
<Parameter label="Add rug:" type="comboBox" default="FALSE;TRUE" notnull="true"/>
<Parameter label="Tick size:" type="doubleSpinBox" default="0.03" notnull="true"/>
<Parameter label="Tick width:" type="doubleSpinBox" default="0.50" notnull="true"/>
<Parameter label="Rug placement:" type="comboBox" default="1;3" notnull="true"/>
<Parameter label="help" type="helpString" default="topic:density" notnull="true"/>
</RTool>
<RTool name="Descriptive statistics" category= "Statistics" query=
"local({

tmp <- data.frame(|1|)

keep <- names(tmp)

first <- TRUE

for (i in 1:ncol(tmp)) {

x <- unlist(tmp[i])

if (!is.numeric(x)) { # Not a numeric vector!

Res <- list(median=NA, mean=NA, var=NA, stddev=NA, coefvar=NA,
min=NA, max=NA, sum=NA, range=NA, nas=NA, nulls=NA, count=NA)

} else {

Nas <- sum(as.numeric(is.na(x)))

x <- x[!is.na(x)]

Vals <- length(x)

Nulls <- sum(as.numeric(x==0))

Min <- min(x)

Max <- max(x)

Range <- Max-Min

Sum <- sum(x)

Median <- median(x)

Mean <- mean(x)

Var <- var(x)

StdDev <- sqrt(Var)

CoefVar <- StdDev/Mean

Res <- list(median=Median, mean=Mean, var=Var, stddev=StdDev, coefvar=CoefVar,
min=Min, max=Max, sum=Sum, range=Range, nas=Nas, nulls=Nulls, count=Vals)

}

if (first) {

Out <- data.frame(Res)

first <- FALSE 

} else {

Out <- rbind(Out, Res)

}

}

row.names(Out) <- as.list(keep)

Out

})">
<Parameter label="Input data:" type="spComboBox" default="numeric;data.frame;integer" notnull="true"/>
<Parameter label="help" type="helpString" default="
<h4>Descriptive statistics help</h4>
Produce table of descriptive statistics including median, mean, variance, standard deviation,
coeficient of variation, minimum, maximum, sum, range, as well as the number of NAs, Nulls (0),
and the total count.<br>
<b>Note</b>: None numeric vectors and data.frame fields will return NAs for all
descriptive statistics.<br><br>
This tool is based on the <tt>stat.desc</tt> function from the <tt>pastecs</tt>
library." notnull="true"/>
</RTool>
<RTool name="Summary statistics" category= "Statistics" query=
"local({

summary(|1|)
})">
<Parameter label="Input data:" type="spComboBox" default="all" notnull="true"/>
<Parameter label="help" type="helpString" default="topic:summary" notnull="true"/>
</RTool>
<RTool name="Correlation matrix" category= "Statistics" query=
"local({

tmp <- data.frame(|1|)

cor(tmp, use='|2|', method='|3|')

})">
<Parameter label="Input data:" type="spListWidget" default="numeric;integer" notnull=","/>
<Parameter label="Use (with NAs):" type="comboBox" default=
"everything;all.obs;complete.obs;na.or.complete;pairwise.complete.obs"
notnull="true"/>
<Parameter label="Method:" type="comboBox" default="pearson;kendall;spearman" notnull="true"/>
<Parameter label="help" type="helpString" default="topic:cor" notnull="true"/>
</RTool>
<RTool name="Linear regression" category= "Statistics" query=
"local({

if (|3|) summary.lm(lm(|1| ~ |2|))

else summary.lm(lm(|1| ~ 0 + |2|))

})">
<Parameter label="Dependant variable:" type="spComboBox" default="numeric;integer" notnull="true"/>
<Parameter label="Independent variables:" type="spListWidget" default="numeric;integer" notnull="+"/>
<Parameter label="Include intercept:" type="comboBox" default="TRUE;FALSE" notnull="true"/>
<Parameter label="help" type="helpString" default="topic:lm" notnull="true"/>
</RTool>
<RTool name="Create spatial weights" category= "Spatial operations" query=
"require(spdep)

|7| <- local({

input <- |1|

type <- '|2|'

value <- |3|

style <- '|6|'

if ('|4|'=='binary') decay <- 1

else decay <- |5|

if (type=='contiguity') {

weights <- poly2nb(pl=input, snap=0.0005, queen=T) #Better parameter for snap?

if (value >= 2) {

nblags <- nblag(neighbours=weights, maxlag=value)

weights <- nblag.cumul(nblags=nblags)

}

} else {

ids <- seq(1,dim(input@data)[1])

proj4 <- proj4string(input)

coords <- coordinates(obj=input)

points <- SpatialPoints(coords=coords, proj4string=CRS(proj4))

if (type=='distance') {

dist <- dnearneigh(x=points, d1=0, d2=value, row.names=ids)

} else { # 'knearest'

knear <- knearneigh(x=points, k=value)

dist <- knn2nb(knn=knear, row.names=ids, sym=FALSE)

}

dlist <- nbdists(nb=dist, coords=points)

decayfun <- function(x) 1/(x^decay)

idlist <- lapply(X=dlist, FUN=decayfun)

weights <- nb2listw(neighbours=dist, glist=idlist, style=style, zero.policy=T)

}

})">
<Parameter label="Input layer:" type="spComboBox" default=
"SpatialPointsDataFrame;SpatialLinesDataFrame;SpatialPolygonsDataFrame" notnull="true"/>
<Parameter label="Spatial neighbourhood type:" type="comboBox" default="distance;knearest;contiguity" notnull="true"/>
<Parameter label="Distance or K neighbours or K lags:" type="doubleSpinBox" default="1.00" notnull="true"/>
<Parameter label="Weighting scheme:" type="comboBox" default="binary;inverse.distance" notnull="true"/>
<Parameter label="Distance decay:" type="doubleSpinBox" default="1.00" notnull="true"/>
<Parameter label="Weighting style:" type="comboBox" default="W;B;C;U;S" notnull="true"/>
<Parameter label="Output name:" type="lineEdit" default="weights" notnull="true"/>
<Parameter label="help" type="helpString" default="topic:nb2listw" notnull="true"/>
</RTool>
<RTool name="Moran scatterplot" category= "Plotting" query=
"require(spdep)

local({

moran.plot(|1|, |2|, zero.policy=FALSE, spChk=FALSE, quiet=ifelse(|3|,FALSE,TRUE),
main='|4|', sub='|5|', xlab='|6|', ylab=paste('Spatially lagged','|6|'),
bty='|7|', labels=|3|)

})">
<Parameter label="Input layer:" type="spComboBox" default="numeric;integer" notnull="true"/>
<Parameter label="Weights object (listw):" type="spComboBox" default="listw" notnull="true"/>
<Parameter label="Display influential variables:" type="comboBox" default="TRUE;FALSE" notnull="true"/>
<Parameter label="Main title:" type="lineEdit" default="Moran scatterplot" notnull="false"/>
<Parameter label="Sub title:" type="lineEdit" default="" notnull="false"/>
<Parameter label="X label:" type="lineEdit" default="X Axis" notnull="false"/>
<Parameter label="Bounding box:" type="comboBox" default=
"outline;l-shape;7-shape;c-shape;u-shape;]-shape;none" notnull="true"/>
<Parameter label="help" type="helpString" default="topic:moran.plot" notnull="true"/>
</RTool>
<RTool name="Moran's I" category= "Spatial statistics" query=
"require(spdep)

local({

moran.test(|1|, |2|, randomisation=ifelse('|3|'=='normality',FALSE,TRUE), alternative='|4|', rank=|5|)


})">
<Parameter label="Input layer:" type="spComboBox" default="numeric;integer" notnull="true"/>
<Parameter label="Weights object (listw):" type="spComboBox" default="listw" notnull="true"/>
<Parameter label="Variance assumption:" type="comboBox" default="randomisation;normality" notnull="true"/>
<Parameter label="Alternative hypothesis:" type="comboBox" default="greater;less;two.sided" notnull="true"/>
<Parameter label="Ranked data:" type="comboBox" default="FALSE;TRUE" notnull="true"/>
<Parameter label="help" type="helpString" default="topic:moran.test" notnull="true"/>
</RTool>
<RTool name="Moran's I permutation test" category= "Spatial statistics" query=
"require(spdep)

|6| <- moran.mc(|1|, |2|, nsim=|3|, alternative='|4|')

if (|5|) plot(|6|)

if (|7|) |6|">
<Parameter label="Input layer:" type="spComboBox" default="numeric;integer" notnull="true"/>
<Parameter label="Weights object (listw):" type="spComboBox" default="listw" notnull="true"/>
<Parameter label="Number of simulations:" type="doubleSpinBox" default="99" notnull="true"/>
<Parameter label="Alternative hypothesis:" type="comboBox" default="greater;less;two.sided" notnull="true"/>
<Parameter label="Display density plot:" type="comboBox" default="FALSE;TRUE" notnull="true"/>
<Parameter label="Output name:" type="lineEdit" default="perm.moran" notnull="true"/>
<Parameter label="Print results:" type="comboBox" default="TRUE;FALSE" notnull="true"/>
<Parameter label="help" type="helpString" default="topic:moran.mc" notnull="true"/>
</RTool>
<RTool name="Geary's c" category= "Spatial statistics" query=
"require(spdep)

local({

geary.test(|1|, |2|, randomisation=ifelse('|3|'=='normality',FALSE,TRUE), alternative='|4|')


})">
<Parameter label="Input layer:" type="spComboBox" default="numeric;integer" notnull="true"/>
<Parameter label="Weights object (listw):" type="spComboBox" default="listw" notnull="true"/>
<Parameter label="Variance assumption:" type="comboBox" default="randomisation;normality" notnull="true"/>
<Parameter label="Alternative hypothesis:" type="comboBox" default="greater;less;two.sided" notnull="true"/>
<Parameter label="help" type="helpString" default="topic:geary.test" notnull="true"/>
</RTool>
<RTool name="Geary's c permutation test" category= "Spatial statistics" query=
"require(spdep)

|6| <- geary.mc(|1|, |2|, nsim=|3|, alternative='|4|')

if (|5|) plot(|6|)

if (|7|) |6|">
<Parameter label="Input layer:" type="spComboBox" default="numeric;integer" notnull="true"/>
<Parameter label="Weights object (listw):" type="spComboBox" default="listw" notnull="true"/>
<Parameter label="Number of simulations:" type="doubleSpinBox" default="99" notnull="true"/>
<Parameter label="Alternative hypothesis:" type="comboBox" default="less;greater" notnull="true"/>
<Parameter label="Display density plot:" type="comboBox" default="FALSE;TRUE" notnull="true"/>
<Parameter label="Output name:" type="lineEdit" default="perm.gery" notnull="true"/>
<Parameter label="Print results:" type="comboBox" default="TRUE;FALSE" notnull="true"/>
<Parameter label="help" type="helpString" default="topic:geary.mc" notnull="true"/>
</RTool>
<RTool name="Local Gi statistics" category= "Spatial statistics" query=
"require(spdep)

|4| <- local({
if (|3|) weights <- nb2listw(include.self(|2|$neighbours),
style=|2|$style,glist=lapply(|2|$weights, function(x) c(1,x)))

else weights <- weights

localG(|1|, weights)

})

if (|5|) |4|">
<Parameter label="Input layer:" type="spComboBox" default="numeric;integer" notnull="true"/>
<Parameter label="Weights object (listw):" type="spComboBox" default="listw" notnull="true"/>
<Parameter label="Gi* Statistic:" type="comboBox" default="TRUE;FALSE" notnull="true"/>
<Parameter label="Output name:" type="lineEdit" default="local.Gi" notnull="true"/>
<Parameter label="Print results:" type="comboBox" default="FALSE;TRUE" notnull="true"/>
<Parameter label="help" type="helpString" default="topic:localG" notnull="true"/>
</RTool>
<RTool name="Local Moran's Ii statistic" category= "Spatial statistics" query=
"require(spdep)

|5| <- local({
localmoran(|1|, |2|, alternative='|3|', p.adjust.method='|4|')

})

if (|6|) |5|">
<Parameter label="Input layer:" type="spComboBox" default="numeric;integer" notnull="true"/>
<Parameter label="Weights object (listw):" type="spComboBox" default="listw" notnull="true"/>
<Parameter label="Alternative hypothesis:" type="comboBox" default="greater;less;two.sided" notnull="true"/>
<Parameter label="P-value adjustment:" type="comboBox" default="none;bonferroni;holm;hochberg;hommel;fdr" notnull="true"/>
<Parameter label="Output name:" type="lineEdit" default="local.moran" notnull="true"/>
<Parameter label="Print results:" type="comboBox" default="FALSE;TRUE" notnull="true"/>
<Parameter label="help" type="helpString" default="topic:localmoran" notnull="true"/>
</RTool>
<RTool name="Load data" category="soRvi" query=
"data(|1|)">
<Parameter label="Data set:" type="dataComboBox" default="sorvi" notnull="true"/>
</RTool>
</manageRTools>