ipeadata-lab / ipeaplot

ipeaplot: criando graficos no padrão editorial do Ipea
https://ipeadata-lab.github.io/ipeaplot/
Other
1 stars 0 forks source link

1: In rbind(test, temp) : number of columns of result is not a multiple of vector length (arg 2) #42

Closed cavalcanti1985 closed 3 months ago

cavalcanti1985 commented 4 months ago

Olá @PedroJorge7 . Os gráficos 1 e 2 estão iguais. O gráfico 5 está corrigido, mas usando o código do cookbook os labels do eixo x estão aparecendo a cada dois anos. (lembrando aqui que eu não testei todos os gráficos, eu só coloquei o 1, 2, e 5 como exemplos). Usando o commit 39b6aeb. Um ponto a se notar é o aparecimento de alguns warnings. No gráfico 1 apareceu o seguinte:

Warning messages: 1: In rbind(test, temp) : number of columns of result is not a multiple of vector length (arg 2) 2: In ggplot_add.scale_auto_ipea(object, p, objectname) : Due to the existence of a bar chart, the expand_y_limit argument will be converted to FALSE 3: In ggplot_add.scale_auto_ipea(object, p, objectname) : Due to the existence of a bar chart, the x_breaks argument will be converted to the number of options available

Originally posted by @palmaresk8 in https://github.com/ipeadata-lab/ipeaplot/issues/41#issuecomment-1991391553

PedroJorge7 commented 3 months ago

Opa @cavalcanti1985. Nos últimos commits fiz o ajuste para esse warning do rbind. Também testei o label do eixo x do gráfico 5 e parece que foi resolvido (por algum motivo quando testei a primeira vez parecia ter resolvido, mas reiniciando o R o problema voltava a persistir).

graf5 <- ggplot(base_graf5, aes(Ano, value, group=variable, color=variable))+
  geom_line(linewidth=1)+
  geom_point(aes(shape=variable, fill = variable),
             size=3, stroke=1.5, show.legend = F)+
  labs(color = "",
       title="GRÁFICO 5",
       subtitle="Crescimento anual do PIB da União Europeia (2004-2013) (Em %)",
       caption = 'Fonte: World Bank (2014).\nTradução dos autores.\nObs.: Os dados foram coletados no sítio do Banco Mundial.\nDisponível em: <http://goo.gl/IvtZ1a>. Acesso em: 26 set. 2014.') +
  theme_ipea(x_breaks = 8, y_breaks = 10, legend.position = 'bottom',
             expand_y_limit = T,expand_x_limit = F,
             include_x_text_title = F,include_y_text_title = F) +
  scale_color_ipea(palette_direction = -1, ) +
  scale_shape_manual(values = c(19, 21)) +
  scale_fill_manual(values = c(NA,"white"))
graf5

image

cavalcanti1985 commented 3 months ago

Testei na minha máquina e me parece resolvido, @PedroJorge7. Abs.