# NOT RUN {
#-------------------------------------------------------------------
# Example on Sphere : Uniform Samples
#
# Each of 4 classes consists of 20 uniform samples from uniform
# density on 2-dimensional sphere S^2 in R^3.
#-------------------------------------------------------------------
## PREPARE DATA OF 4 CLASSES
ndata = 200
class1 = list()
class2 = list()
class3 = list()
class4 = list()
for (i in 1:ndata){
tmpxy = matrix(rnorm(4*2, sd=0.1), ncol=2)
tmpz = rep(1,4)
tmp3d = cbind(tmpxy, tmpz)
tmp = tmp3d/sqrt(rowSums(tmp3d^2))
class1[[i]] = tmp[1,]
class2[[i]] = tmp[2,]
class3[[i]] = tmp[3,]
class4[[i]] = tmp[4,]
}
obj1 = wrap.sphere(class1)
obj2 = wrap.sphere(class2)
obj3 = wrap.sphere(class3)
obj4 = wrap.sphere(class4)
## RUN THE ASYMPTOTIC TEST
riem.fanova(obj1, obj2, obj3, obj4)
# }
# NOT RUN {
## RUN THE PERMUTATION TEST WITH MANY PERMUTATIONS
riem.fanovaP(obj1, obj2, obj3, obj4, nperm=999)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab