Skip to content

Commit

Permalink
doc: vars_to_date examples
Browse files Browse the repository at this point in the history
  • Loading branch information
dnldelarosa committed Nov 13, 2023
1 parent 802e51e commit d66f201
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: Dmisc
Title: Daniel miscellaneous functions
Version: 0.3.2
Version: 0.3.3
Authors@R:
person(given = "Daniel E.",
family = "de la Rosa",
Expand Down
21 changes: 19 additions & 2 deletions R/vars_to_date.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#' @export
#'
#' @examples
#' \dontrun{
#' tbl <- data.frame(
#' year = rep("2021", 12),
#' month = month.name,
Expand All @@ -30,7 +29,25 @@
#' tbl
#'
#' vars_to_date(tbl, year = 1, month = 2, day = 3)
#' }
#'
#' # y soporta varias frecuencias y formatos de fechas
#'
#' tbl <- data.frame(
#' year = rep("2021", 12),
#' quarter = sample(
#' c(
#' "Enero-Marzo",
#' "Abril-Junio",
#' "Julio-Septiembre",
#' "Octubre-Diciembre"
#' )
#' ),
#' value = sample(100:1000, 12, TRUE)
#' )
#'
#' tbl
#'
#' vars_to_date(tbl, year = 1, quarter = 2)
vars_to_date <- function(
tbl, year = NULL, quarter = NULL, month = NULL,
day = NULL, date = NULL, drop_vars = TRUE,
Expand Down
21 changes: 19 additions & 2 deletions man/vars_to_date.Rd

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

0 comments on commit d66f201

Please sign in to comment.