loosely-coupled-dss/results/analysis.R
2021-05-10 10:33:11 +02:00

17 lines
652 B
R

library("tidyverse")
library("knitr")
data=read_csv("results.csv")
final=data%>%group_by(simkey,wireless,wakeupfor)%>%summarize(energy=mean(energy),wireless=first(wireless),sd=sd(energy),wakeupfor=first(wakeupfor))
ggplot(final,aes(x=simkey,y=energy))+
geom_bar(stat="identity",aes(fill=wireless),position=position_dodge())+
xlab("Scenarios")+ylab("Energy (J)")+
geom_errorbar(aes(ymin=energy-sd, ymax=energy+sd),width=.2,size=1.5) +
facet_wrap(~ wakeupfor)
for(wake in unique(data$wakeupfor)){
print(kable(final%>%filter(wireless=="lora",wakeupfor==wake)))
print(kable(final%>%filter(wireless!="lora",wakeupfor==wake)))
}