【问题标题】:Standardized Precipitation index using SPEI使用 SPEI 的标准化降水指数
【发布时间】:2019-08-29 18:56:13
【问题描述】:

我正在尝试使用 R 中提供的 Wichita 数据开发标准化降水指数 (SPI),我正在使用“SPEI”包。我可以生成 SPI 图,但是质量不适合发表。我在这里发现了一个非常相似的问题: How to format the x-axis of the hard coded plotting function of SPEI package in R?

当我尝试上面链接中提供的代码时,我可以为 SPEI 生成高质量的图形,但不能为 SPI 生成。我在以下行中遇到了问题: dplyr::mutate(sign = ifelse(ET0_har >= 0, "pos", "neg")) 的代码。我的具体问题是我应该使用什么来代替“ET0_har”来在上面的行中生成 SPI?

感谢您为生成上述链接中提供的 SPI 图提供的输入。这是我的代码:

install.packages("SPEI")
library(SPEI)
data("wichita")
SPI1<-spi(wichita$PRCP,scale = 1, distribution = 'Gamma')
plot(SPI1)

【问题讨论】:

    标签: r ggplot2


    【解决方案1】:

    将行改为:

    dplyr::mutate(sign = ifelse(`Series 1` >= 0, "pos", "neg")) 
    

    然后就可以了。

    【讨论】:

      猜你喜欢
      • 2023-02-25
      • 2019-03-06
      • 2017-10-09
      • 2019-12-18
      • 1970-01-01
      • 2016-04-18
      • 1970-01-01
      • 2018-05-19
      • 1970-01-01
      相关资源
      最近更新 更多