ggplot2
is the name of the package but, the function you need to use from that package is ggplot()
.
library(ggplot2)
ggplot(data_sum, aes(x = habitat, y = biomass, fill = habitat)) +
geom_bar(position = position_dodge(.9), stat = "identity") +
geom_errorbar(aes(ymin = biomass - se, ymax = biomass + se), width = .1) +
xlab("Habitat") +
ylab("Predator biomass (g.m-2)")
If this doesn't solve your problem, please provide a proper REPRoducible EXample (reprex) illustrating your issue.