updated CTgov file

bug with merged AEs fixed
R code

code needs explanation, email me with questions