Utility functions for data analysis in R.