我有一个data frame
包含(1948-2013)期间的一些信息。每年还包含数据方面的数据4 season
。现在有时,年份包含positive
和negative
数据。我的数据样本
YEAR Region temp_avg_max temp_avg_min temp_dif_avg_max whole_avg_min_temp
<int> <chr> <dbl> <dbl> <dbl> <dbl>
1 1948 Central egion 33.1 20.6 -0.400 -0.516
2 1948 Eastern Region 32.7 19.1 -0.775 -2.08
3 1948 Northern Region 33.5 20.2 0.0124 -0.970
4 1948 Northsouthern Region 33.5 21.3 0.0443 0.154
5 1948 Northwestern Region 31.6 20.9 -1.88 -0.232
6 1948 Southeastern Region 32.5 21.8 -0.958 0.676
7 1949 Central egion 33.1 20.6 -0.400 -0.516
8 1949 Eastern Region 32.7 19.1 -0.775 -2.08
9 1949 Northern Region 33.5 20.2 0.0124 -0.970
10 1949 Northsouthern Region 33.5 21.3 0.0443 0.154
11 1949 Northwestern Region 31.6 20.9 -1.88 -0.232
12 1949 Southeastern Region 32.5 21.8 -0.958 0.676
现在我想画一个column graph
,我也画了。我的代码如下
plot_diff_max_temp_vs_year_region_col <- ggplot(data=diff_max_temp[diff_max_temp$YEAR %in% c(1948, 1960, 1972, 1984, 1996, 2008, 2013),],
aes(x=Region, y=temp_dif_avg_max, fill=factor(YEAR)))+
geom_col(position="identity", width = 0.5)+
geom_text(aes(label=sprintf("%0.1f", round(year_wise_region_max_temp, digits = 2))),
position=position_dodge(width=0.9), vjust=-0.50)+
theme_minimal()+
xlab("Region")+
ylab("Temperature")+
ggtitle("Max Temp with 12 years moving ")
你可以看看我的图表在听到在线情节链接
但是,我想以这种方式绘制它们(将添加所有负值和正值)Region
,然后绘制column
.
任何指导方针表示赞赏