File: prabclustests.R

package info (click to toggle)
r-cran-prabclus 2.3-1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,396 kB
  • sloc: sh: 13; makefile: 2
file content (51 lines) | stat: -rw-r--r-- 1,510 bytes parent folder | download | duplicates (3)
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
library(prabclus)
options(digits=4)

data(kykladspecreg)
data(nb)
set.seed(1234)
x <- prabinit(prabmatrix=kykladspecreg, neighborhood=nb)

p1 <- prabtest(x, times=3, pd=0.35, ignore.richness=TRUE)
p2 <- prabtest(x, times=3, pd=0.35, teststat="lcomponent")
p3 <- prabtest(x, times=3, pd=0.35, teststat="isovertice")
p4 <- prabtest(x, times=3, pd=0.35, teststat="nn", sf.sim=TRUE)
p5 <- prabtest(x, times=3, pd=0.35, teststat="inclusions")
summary(p1)
summary(p2)
summary(p3)
summary(p4)
summary(p5)

data(veronica)
vnb <- coord2dist(coordmatrix=veronica.coord[1:50,], cut=20,
                  file.format="decimal2",neighbors=TRUE)
vei <- prabinit(prabmatrix=veronica[1:50,],
                neighborhood=vnb$nblist,nbbetweenregions=FALSE,
                distance="jaccard")
print(vei)

library(spdep)
data(siskiyou)
x <- prabinit(prabmatrix=siskiyou, neighborhood=siskiyou.nb,
            distance="logkulczynski")
build.nblist(x)
a1 <- abundtest(x, times=5, p.nb=0.0465)
a2 <- abundtest(x, times=5, p.nb=0.0465, teststat="groups",
                groupvector=siskiyou.groups)
# These settings are chosen to make the example execution
# faster; usually you will use abundtest(x).
summary(a1)
summary(a2)

options(digits=2)
prab.sarestimate(x)
regpop.sar(x, p.nb=0.046)
options(digits=4)

x <- prabinit(prabmatrix=siskiyou, neighborhood=siskiyou.nb, distance="none",toprab=TRUE,toprabp=0.5)
x2 <- prabinit(prabmatrix=siskiyou, neighborhood=siskiyou.nb, distance="none",toprab=TRUE,toprabp=0)
x$prab
x2$prab