I'm a PhD student who's currently navigating R.
I've got a rather large dataset looking at the mass of leaves, organized by where they're found on the plant. For a part of this project, we'd like to see the combined mass and mean mass for the treatments.
Unfortunately, our code seems to be just summing up the mass of all leaves in the study.
I've pared down all the packages to 4 essential packages to eliminate the possibility of conflicts between the packages, and I've used Conflicted to try and determine if there's any conflicts (there aren't).
The output for the code below is simply 47588, the combined mass of all leaves in this study. It should be analyzing them using our treatments.
What do y'all think?
Mass.dat <- read_excel("CoSAR Final.xlsx", sheet = "ImageJ", na="NA") %>%
mutate(Treatment = as.factor(Treatment),
Whorl = as.factor(Whorl))
Mass.mean<-summarySE(Mass.dat,measurevar = "Leaf.Mass",
groupvars = c("Whorl","Treatment"),
na.rm = T)
Mass.mean2 <- Mass.dat %>%
group_by(Treatment) %>%
summarize(Leaf.Mass.mean = sum(Leaf.Mass, na.rm=TRUE))
data.frame(Mass.mean2)