The problem is the for loop. You need to use print in a loop.
for (i in sp) {
table <- data[data$sp=="A",]
windows()
ggp <- ggplot(...) + ...
print(ggp)
}
Consider this simple example:
library(ggplot2)
df=data.frame(x=1:10,y=rnorm(10)) # sample data
ggplot(df)+geom_point(aes(x,y)) # render ggplot
for (i in 1:2) ggplot(df)+geom_point(aes(x,y)) # nothing
for (i in 1:2) print(ggplot(df) + geom_point(aes(x,y))) # renders
Also, as @user229552 says, you are using the same table both times.