#!/usr/bin/Rscript points <- runif(10000) dim(points) <- c(5000,2) distances <- apply(points, 1, function(x) sqrt(sum(x^2))) par(mfrow=c(2,2)) hist(distances) boxplot(distances) plot(ecdf(distances)) qqnorm(distances) X11() plot(points)