Correct rounding

This commit is contained in:
Loic Guegan 2021-07-21 07:45:20 +02:00
parent 9ed3712789
commit 3b6e0ab0b8
3 changed files with 6 additions and 6 deletions

Binary file not shown.

Binary file not shown.

View file

@ -41,10 +41,10 @@ energy60Baseline=energy60%>%filter(simkey=="baseline")%>%uncount(nsimkeys,.id="i
energy60=energy60%>%left_join(energy60Baseline,by=c("simkey","wireless","type"),suffix = c("","_baseline")) energy60=energy60%>%left_join(energy60Baseline,by=c("simkey","wireless","type"),suffix = c("","_baseline"))
energy60=energy60%>%mutate(ovhd=energy*100/energy_baseline-100) energy60=energy60%>%mutate(ovhd=energy*100/energy_baseline-100)
energy60=energy60%>%rowwise()%>%mutate(ovhd_txt=paste0("(",s_(ovhd),r_(ovhd),"%)")) energy60=energy60%>%rowwise()%>%mutate(ovhd_txt=paste0("(",s_(ovhd),r_(ovhd),"%)"))
success60Snd=data%>%filter(wakeupfor==60)%>%filter(isSender!=0)%>%group_by(simkey,wireless,wakeupfor)%>%summarise(success_orig=mean(nSend),success=r_(mean(nSend)),type="Sender") success60Snd=data%>%filter(wakeupfor==60)%>%filter(isSender!=0)%>%group_by(simkey,wireless,wakeupfor)%>%summarise(success_orig=mean(nSend),success=mean(nSend),type="Sender")
success60Rcv=data%>%filter(wakeupfor==60)%>%filter(isSender!=0)%>%group_by(simkey,wireless,wakeupfor)%>%summarise(success_orig=mean(nSend),success=r_(mean(nSend)),type="Receiver") success60Rcv=data%>%filter(wakeupfor==60)%>%filter(isSender!=0)%>%group_by(simkey,wireless,wakeupfor)%>%summarise(success_orig=mean(nSend),success=mean(nSend),type="Receiver")
success60=rbind(success60Snd,success60Rcv) success60=rbind(success60Snd,success60Rcv)
success60=success60%>%rowwise()%>%mutate(success_txt=paste0("[",success,"]")) success60=success60%>%rowwise()%>%mutate(success_txt=paste0("[",r_(success),"]"))
energy60=energy60%>%left_join(success60)%>%rowwise()%>%mutate(infos=paste0(ovhd_txt,"\n{",r_(energy/success_orig),"}")) energy60=energy60%>%left_join(success60)%>%rowwise()%>%mutate(infos=paste0(ovhd_txt,"\n{",r_(energy/success_orig),"}"))
energy60=energy60%>%mutate(type=factor(type,levels = c("Sender","Receiver"))) energy60=energy60%>%mutate(type=factor(type,levels = c("Sender","Receiver")))
@ -70,10 +70,10 @@ energy180Baseline=energy180%>%filter(simkey=="baseline")%>%uncount(nsimkeys,.id=
energy180=energy180%>%left_join(energy180Baseline,by=c("simkey","wireless","type"),suffix = c("","_baseline")) energy180=energy180%>%left_join(energy180Baseline,by=c("simkey","wireless","type"),suffix = c("","_baseline"))
energy180=energy180%>%mutate(ovhd=energy*100/energy_baseline-100) energy180=energy180%>%mutate(ovhd=energy*100/energy_baseline-100)
energy180=energy180%>%rowwise()%>%mutate(ovhd_txt=paste0("(",s_(ovhd),r_(ovhd),"%)")) energy180=energy180%>%rowwise()%>%mutate(ovhd_txt=paste0("(",s_(ovhd),r_(ovhd),"%)"))
success180Snd=data%>%filter(wakeupfor==180)%>%filter(isSender!=0)%>%group_by(simkey,wireless,wakeupfor)%>%summarise(success_orig=mean(nSend),success=r_(mean(nSend)),type="Sender") success180Snd=data%>%filter(wakeupfor==180)%>%filter(isSender!=0)%>%group_by(simkey,wireless,wakeupfor)%>%summarise(success_orig=mean(nSend),success=mean(nSend),type="Sender")
success180Rcv=data%>%filter(wakeupfor==180)%>%filter(isSender!=0)%>%group_by(simkey,wireless,wakeupfor)%>%summarise(success_orig=mean(nSend),success=r_(mean(nSend)),type="Receiver") success180Rcv=data%>%filter(wakeupfor==180)%>%filter(isSender!=0)%>%group_by(simkey,wireless,wakeupfor)%>%summarise(success_orig=mean(nSend),success=mean(nSend),type="Receiver")
success180=rbind(success180Snd,success180Rcv) success180=rbind(success180Snd,success180Rcv)
success180=success180%>%rowwise()%>%mutate(success_txt=paste0("[",success,"]")) success180=success180%>%rowwise()%>%mutate(success_txt=paste0("[",r_(success),"]"))
energy180=energy180%>%left_join(success180)%>%rowwise()%>%mutate(infos=paste0(ovhd_txt,"\n{",r_(energy/success_orig),"}")) energy180=energy180%>%left_join(success180)%>%rowwise()%>%mutate(infos=paste0(ovhd_txt,"\n{",r_(energy/success_orig),"}"))
energy180=energy180%>%mutate(type=factor(type,levels = c("Sender","Receiver"))) energy180=energy180%>%mutate(type=factor(type,levels = c("Sender","Receiver")))