data(iris)
hv1 = hypervolume(subset(iris, Species=="setosa")[,1:4],bandwidth=0.2)
hvboxdata = expectation_box(hv1, userandom=FALSE)
hvboxrandom = expectation_box(hv1, userandom=TRUE)
# show the two expectations
#plot(hypervolume_join(hv1, hvboxdata))
#plot(hypervolume_join(hv1, hvboxrandom))
# ball expectation
hvballdata = expectation_ball(hv1@Data, userandom=FALSE, npoints=10000)
hvballrandom = expectation_ball(hv1, userandom=TRUE, npoints=10000)
# show the two expectations
#plot(hypervolume_join(hv1, hvballdata))
#plot(hypervolume_join(hv1, hvballrandom))
Run the code above in your browser using DataLab