Use R calculate sleep quailty