Report code in R and SQL