Solution: Create a Bar Graph for Each Tank in the Experiment
Let's look at the solution of the previous exercise.
Solution
The main task in this assignment is to plot each tank in the experiment. Since we’re also supposed to have error bars for each bar, that means we’ll use the raw data, RxP.clean
, instead of the summarized data, RxP.byTank
. Let’s make sure we have that data loaded and ready to go:
#We're going to go ahead and make the logged versions of these variablesRxP.clean$log.SVL.final<-log(RxP.clean$SVL.final)RxP.clean$log.Age.FromEmergence<-log(RxP.clean$Age.FromEmergence)RxP.clean$log.Age.DPO<-log(RxP.clean$Age.DPO)RxP.clean$log.Mass.final<-log(RxP.clean$Mass.final)#Remember to reorder the Pred factorRxP.clean$Pred<-factor(RxP.clean$Pred, levels=c("C","NL","L"))str(RxP.clean)
As was mentioned previously, we’ll be exploring two different variables, which are time to resorb the tail Resorb.days
and final SVL at metamorphosis SVL.final
. The basic process will be the same for each variable:
- Group the data and calculate the means and standard errors.
- Plot the data for each tank in the experiment.
Time needed to fully resorb the tail after leaving the water
The first thing we need to do is summarize the data for each tank. We’ll want to make sure we group the data by Tank.Unique
and not just Tank
. Summarizing based on just Tank
would lump tanks together across blocks, which is certainly not what we want. That ...