R-scripts for statistical and image analysis