I'm new to R. I'm trying to run an analysis of variance (aov) on my "new.data" frame. My original data was titled "data" then i reorganized it into "new.data". I can see when I view the data table that "new.data" contains the column "oysters.consumed" but I keep getting an error telling me that it can't be found. Can anyone tell me why? it works when i use the the original data frame "data", just not when i try to use "new.data".
new.data <- data %>%
group_by(sound.treatment, tank) %>%
summarise(osyters.consumed = sum(oysters.consumed))
aov <- aov(oysters.consumed~sound.treatment, data = new.data)
my aov code isn't working. I keep getting the error:
Error in eval(predvars, data, env) : object 'oysters.consumed' not found