Assuming by "group", you meant the binary variable Type
, I have the following two solutions for you, using lattice
and ggplot2
packages, respectively:
Before plotting, I reconstituted a (limited version of?) your data:
df <- data.frame(
Type = rep(c("Treatment", "Control"), 2),
Species = c(rep("Species A", 2), rep("Species B", 2)),
Number_of_Occurrences = c(10, 15, 55, 5)
)
df
# Type Species Number_of_Occurrences
# 1 Treatment Species A 10
# 2 Control Species A 15
# 3 Treatment Species B 55
# 4 Control Species B 5
First method: lattice
package:
library(lattice)
barchart(
Number_of_Occurrences~Species,
data=df, groups=Type,
scales=list(x=list(rot=90,cex=0.8))
)

Second method, ggplot2
package; you will need to reformat the data.frame using reshape::melt
function to meet the requirement of ggplot2
library(reshape)
library(ggplot2)
df.m <- melt(df)
df.m
# Type Species variable value
# 1 Treatment Species A Number_of_Occurrences 10
# 2 Control Species A Number_of_Occurrences 15
# 3 Treatment Species B Number_of_Occurrences 55
# 4 Control Species B Number_of_Occurrences 5
ggplot(df.m, aes(Species, value, fill = Type)) +
geom_bar(stat="identity", position = "dodge")

Reference: this Stack Overflow post.