I have an experiment consisting on testing the time it takes a subject to climb on a branch, we have tested this subjects (males and females) from 2016 to 2019 and someare undergoing treatment A or B. I need to build a barplot comparing the time it took females on each treatment for year 2016, to females on each treatment for year 2017 and so on. Same exact for males.
My data is stored on a data base like this:
Year Treatment ID Sex Time(Mins)
2016 A K1 M 1,63
2016 A H4 F 5
2017 B J9 F 3,5
2018 ...
2019 ...
I tried using this code where BD is the name of my data base:
barplot(c(mean(BD$Time[bd2016$Sex=="F" & BD$Treatment=="A" & BD$Year=="2019"]),
(mean(BD$Time[bd2016$Sex=="F" & BD$Treatment=="B" & BD$Year=="2019"]]))),
ylim= c(0,40), ylab="xx",names=c("A","B"))