【发布时间】:2021-06-25 01:16:37
【问题描述】:
这是我的数据:
> head(datos, 10)
t_ventas año n
1 Grande 2012-03-28 2617
2 Mediana 2012-03-28 6281
3 Micro 2012-03-28 37641
4 Pequeña 2012-03-28 16676
5 Grande 2013-03-28 2833
6 Mediana 2013-03-28 6822
7 Micro 2013-03-28 40280
8 Pequeña 2013-03-28 17858
我正在尝试使用这个命令 ggplot 来计算图形
ggplot(datos) +
aes(x = `Año`, y = n, fill = t_ventas, colour = t_ventas) +
geom_line(size = 1L) +
scale_fill_hue() +
scale_color_hue() +
labs(x = "3", y = "4", subtitle = "1", caption = "2") +
theme_light() +
theme(legend.position = "none") +
facet_wrap(vars(t_ventas), scales = "free")
但我收到此错误:
Error in eval(variables_names, envir = envir, enclos = baseenv()) :
object 't_ventas' not found
我认为它必须对 facet_wrap 函数做点什么?
提前致谢
【问题讨论】: