Clinical Trial Optimization Using R