R code for basic screen analysis