analysis R file