Added analyzation function in R.