最初に、日付を含む列に空白行を入れないようにし、日付には年も含める必要があります。どのようにしてデータを取得したかはわかりません。そのため、計算を行うには多少の調整が必要になる場合がありますが、それほど難しくはありません。この場合、手動で行いました:
> df
Periodo Grupo Formacion En.consolidacion Consolidado
1 Ene-Abr.2009 Meta 40 30 30
2 Ene-Abr.2009 Realizado 35 45 20
3 May-Ago.2009 Meta 35 35 30
4 May-Ago.2009 Realizado 34 45 20
5 Sep-Dic.2009 Meta 30 30 40
6 Sep-Dic.2009 Realizado 20 40 20
(スペースの代わりに、変数名にドットを使用しました。)その後、パッケージmelt()
から簡単に使用でき、次のようになります。plyr
facet_wrap
library(ggplot2)
library(plyr)
m=melt(df)
ggplot(m,aes(x=factor(Grupo),y=value,fill=factor(variable))) +
geom_bar(position="fill", stat="identity") +
scale_y_continuous(labels = percent,
breaks=c(0.2,0.4,0.6,0.8,1)) + # you can set the breaks to whatever you want
facet_wrap(~ Periodo)
これは、あなたの望むことですか?

これがあなたの(編集された)データです:
df = structure(list(Periodo = structure(c(1L, 1L, 2L, 2L, 3L, 3L), .Label = c("Ene-Abr.2009",
"May-Ago.2009", "Sep-Dic.2009"), class = "factor"), Grupo = structure(c(1L,
2L, 1L, 2L, 1L, 2L), .Label = c("Meta", "Realizado"), class = "factor"),
Formacion = c(40L, 35L, 35L, 34L, 30L, 20L), En.consolidacion = c(30L,
45L, 35L, 45L, 30L, 40L), Consolidado = c(30L, 20L, 30L,
20L, 40L, 20L)), .Names = c("Periodo", "Grupo", "Formacion",
"En.consolidacion", "Consolidado"), class = "data.frame", row.names = c(NA,
-6L))