FDA analysis R code