See https://github.com/harrelfe/rscripts files named observerVariability*
To load the function definitions into an RStudio session, run
require(Hmisc)
getRs('observerVariability.r', put='source')
To load the demo script into the RStudio script editor window, run
getRs('observerVariability_example.r')