R provides a wide range of functions for the generation of random variables, visualisation of results of analyses, statistical tests etc. with a long list of libraries that can be freely downloaded from your nearest Comprehensive R Archive Network site (see http://cran.r-project.org/). Some of the example code provided here requires libraries to be downloaded and installed, as indicated in the library section for each type of application.
Click on the links below for the different types of routines to download example R code.
Random number generators for different distributions
Generation of sets of independent random variables
Generation of sets of correlated random variables using copulas
HSY Global Sensitivity Analysis
Generalised Likelihood Uncertainty Estimation (GLUE)
Monte Carlo Markov Chain Methods (with a hydrological example)