Use melt() to reshape your data with total as a factor that you can facet on:
BLPcaged = data.frame(sampling_period=c(4,4,5),
cage=c('y','n','n'),
total_1=c(34,89,23),
total_2=c(95,12,10),
total_3=c(12,13,2))
library(reshape2)
BLPcaged.melted = melt(BLPcaged,
id.vars=c('sampling_period','cage'),
variable.name='total')
So now BLPcaged.melted looks like this:
sampling_period cage total value
1 4 y total_1 34
2 4 n total_1 89
3 5 n total_1 23
4 4 y total_2 95
5 4 n total_2 12
6 5 n total_2 10
7 4 y total_3 12
8 4 n total_3 13
9 5 n total_3 2
You can then facet this by total:
ggplot(BLPcaged.melted, aes(sampling_period, value, color=cage)) +
geom_point() +
facet_grid(total~.)