Analysis of empirical data in R