利用R的月数据绘制异常温度图
我能用R的月温度数据绘制异常温度图吗?我没有每日温度数据。我的数据如下:利用R的月数据绘制异常温度图,r,R,我能用R的月温度数据绘制异常温度图吗?我没有每日温度数据。我的数据如下: 1 8.2 JAN-1990 2 5.3 JAN-1991 3 6.2 JAN-1992 4 7.8 JAN-1993 5 6.7 JAN-1994 这就是你想做的吗 # Make the Data Actually Useable a<- c("1 8.2 JAN-1990", "2 5.3 JAN-1991", "3 6.2 JAN-1992", "4 7.8 JAN-1993",
1 8.2 JAN-1990
2 5.3 JAN-1991
3 6.2 JAN-1992
4 7.8 JAN-1993
5 6.7 JAN-1994
这就是你想做的吗
# Make the Data Actually Useable
a<- c("1 8.2 JAN-1990", "2 5.3 JAN-1991",
"3 6.2 JAN-1992", "4 7.8 JAN-1993",
"5 6.7 JAN-1994") %>%
as_data_frame() %>%
separate(value, c("number", "temp", "month"), sep = " ") %>%
mutate(temp = as.numeric(temp),
# Now Convert the Date- Assuming First of Month?
month = lubridate::dmy(paste0("1-",month)))
# Base Way
plot(a$month, a$temp, xlab = "Month", ylab= "Temperature")
# Make the Chart in ggplot2
ggplot(a, aes(month, temp))+
geom_point()+
scale_x_date()
你问的问题并不明显。你能画出每月的数据吗?当然当您只有月度数据时,是否可以绘制每日数据?不,你到底想做什么?我想做一张1990-2017年的异常温度图。但我只有每月的数据。我发现制作异常图的大多数示例都是使用每日数据。所以我想问我是否可以制作异常图,因为我只有每月的数据。我想做一些图,就像这个网站上显示的那样。