Learn R Programming

tidyindex (version 0.1.0)

compute_indexes: Calculate multiple indexes at once

Description

Calculate multiple indexes at once

Usage

compute_indexes(.data, ...)

# S3 method for idx_res augment(x, .id = ".id", ...)

Value

an idx_res object

Arguments

.data

an idx_tbl object

...

Unused, included for generic consistency only

x

an idx_res object, calculated from compute_indexes

.id

a character string, the name of the first column

Examples

Run this code
library(dplyr)
library(lmomco)
library(generics)
res <- tenterfield |>
  mutate(month = lubridate::month(ym)) |>
  init(id = id, time = ym, group = month) |>
  compute_indexes(
    spi = idx_spi(),
    spei = idx_spei(.lat = lat, .tavg = tavg),
    edi = idx_edi()
 )

Run the code above in your browser using DataLab