Skip to content

Commit

Permalink
Arregla error en ejemplo
Browse files Browse the repository at this point in the history
  • Loading branch information
paocorrales committed Jul 29, 2024
1 parent 6d1b454 commit ca2cdc3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion R/ith.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#' # En el contexto de mutate
#' library(dplyr)
#' NH0358 %>%
#' filter(!is.na(hr)) |>
#' filter(!is.na(hr)) %>%
#' mutate(t_media = (t_max + t_min)/2) %>%
#' mutate(ith = ith(t_media, hr)) %>%
#' slice_head(n = 10)
Expand Down
9 changes: 5 additions & 4 deletions R/spi.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#' @examples
#'
#' library(dplyr)
#' data(NH0358)
#'
#' datos_mensuales <- NH0358 %>%
#' group_by(fecha = lubridate::round_date(fecha, "month")) %>%
Expand All @@ -61,16 +62,16 @@
#' # Usando un vector lógico
#' datos_mensuales %>%
#' reframe(spi_indice(fecha, precip, escalas = 1:12,
#' referencia = lubridate::year(fecha) < 2016)) %>%
#' referencia = data.table::year(fecha) < 2016)) %>%
#' slice_head(n = 10)
#'
#' # O un data.frame
#' datos_2016 <- datos %>%
#' filter(lubridate::year(fecha) < 2016)
#' datos_2016 <- datos_mensuales %>%
#' filter(data.table::year(fecha) < 2016)
#'
#' datos_mensuales %>%
#' reframe(spi_indice(fecha, precip, escalas = 1:12,
#' referencia = spi_referencia(datos_2016$fecha, datos_2016$pp)) %>%
#' referencia = spi_referencia(datos_2016$fecha, datos_2016$precip))) %>%
#' slice_head(n = 10)
#'
#'
Expand Down
2 changes: 1 addition & 1 deletion man/ith.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions man/spi_indice.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ca2cdc3

Please sign in to comment.