## Creating a 2D uniform space
space <- space.maker(300, 2, runif)
## A simple test with only 1 replicate for two shifts (random and size):
simple_test <- test.metric(space, metric = c(prod, ranges),
replicates = 1, shifts = c("random", "size"))
## Summarising the tests
summary(simple_test)
## Visualising the test
plot(simple_test)
## Applying the test directly on a disparity object
data(disparity)
median_centroid_test <- test.metric(disparity, shifts = "size")
## Summarising the tests
summary(median_centroid_test)
## Visualising the test
plot(median_centroid_test)
if (FALSE) {
## Note that the tests can take several minutes to run.
## Testing the sum of variance on all shifts
sum_var_test <- test.metric(space, metric = c(sum, variances),
shifts = c("random", "size", "density", "position"))
## Summarising the tests
summary(sum_var_test)
## Visualising the test
plot(sum_var_test)
## Creating a 2D uniform space
space <- space.maker(300, 2, runif)
## Re-running the test on two shifts with data saving for visualisation
median_centroid_test <- test.metric(space,
metric = c(median, centroids),
shifts = c("random", "size"),
save.steps = TRUE)
## Visualising the tests results and display the shifts visualisation
plot(median_centroid_test)
}
Run the code above in your browser using DataLab