diff --git a/NEWS.md b/NEWS.md index a9cf26fe..75307c0b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,6 @@ # tsibble 0.8.2.9000 +* Added lifecycle badges to functions. * `index_by()` supports lambda expression (#91). * Defunct argument `gather` in `as_tsibble.mts()` in favour of `pivot_longer`. * `yearweek()` handles characters containing keywords "W"/"Wk"/"Week", for example `yearweek("2019 W03")`. diff --git a/R/as-tsibble.R b/R/as-tsibble.R index 5a3171ce..f3d0177f 100644 --- a/R/as-tsibble.R +++ b/R/as-tsibble.R @@ -1,5 +1,8 @@ #' Create a tsibble object #' +#' @description +#' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} +#' #' @param ... A set of name-value pairs. The names of "key" and "index" should #' be avoided as they are used as the arguments. #' @param key Unquoted variable(s) that uniquely determine time indices. `NULL` for @@ -152,6 +155,9 @@ as_tsibble.NULL <- function(x, ...) { #' Update key and index for a tsibble #' +#' @description +#' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("maturing")} +#' #' @param x A tsibble. #' @inheritParams as_tsibble #' @details @@ -197,6 +203,9 @@ update_tsibble <- function(x, key, index, regular = is_regular(x), #' Low-level constructor for a tsibble object #' +#' @description +#' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("maturing")} +#' #' `build_tsibble()` creates a `tbl_ts` object with more controls. It is useful #' for creating a `tbl_ts` internally inside a function, and it allows developers to #' determine if the time needs ordering and the interval needs calculating. @@ -287,6 +296,9 @@ build_tsibble <- function(x, key = NULL, key_data = NULL, index, index2 = index, #' Low-level & high-performance constructor for a tsibble object #' +#' @description +#' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("experimental")} +#' #' `build_tsibble_meta()` does much less checks than `build_tsibble()` for #' high performance. #' @@ -336,6 +348,9 @@ build_tsibble_meta <- function(x, key_data = NULL, index, index2, #' Create a subclass of a tsibble #' +#' @description +#' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("maturing")} +#' #' @param x A `tbl_ts`, required. #' @param ... Name-value pairs defining new attributes other than a tsibble. #' @param class Subclasses to assign to the new object, default: none. @@ -474,6 +489,9 @@ as.data.frame.tbl_ts <- function(x, row.names = NULL, optional = FALSE, ...) { #' Test duplicated observations determined by key and index variables #' +#' @description +#' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} +#' #' * `is_duplicated()`: a logical scalar if the data exist duplicated observations. #' * `are_duplicated()`: a logical vector, the same length as the row number of `data`. #' * `duplicates()`: identical key-index data entries. diff --git a/R/dplyr-verbs.R b/R/dplyr-verbs.R index 40aa7ba1..6890ee13 100644 --- a/R/dplyr-verbs.R +++ b/R/dplyr-verbs.R @@ -226,6 +226,9 @@ group_by.tbl_ts <- function(.data, ..., add = FALSE, #' Group by key variables #' +#' @description +#' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} +#' #' @param .data A `tbl_ts` object. #' @param ... Ignored. #' @inheritParams dplyr::group_by diff --git a/R/filter-index.R b/R/filter-index.R index b48198b0..dd494bbb 100644 --- a/R/filter-index.R +++ b/R/filter-index.R @@ -56,6 +56,9 @@ filter_index <- function(.data, ..., .preserve = FALSE) { #' If time falls in the ranges using compact expressions #' +#' @description +#' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("maturing")} +#' #' This function respects time zone and encourages compact expressions. #' #' @param x A vector of time index, such as classes `POSIXct`, `Date`, `yearweek`, diff --git a/R/index-by.R b/R/index-by.R index 3ac8afdf..371cc3d5 100644 --- a/R/index-by.R +++ b/R/index-by.R @@ -2,6 +2,7 @@ #' #' @description #' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} +#' #' `index_by()` is the counterpart of `group_by()` in temporal context, but it #' only groups the time index. The following operation is applied to each partition #' of the index, similar to `group_by()` but dealing with index only. diff --git a/R/index-valid.R b/R/index-valid.R index f1aba082..d23d4c52 100644 --- a/R/index-valid.R +++ b/R/index-valid.R @@ -1,5 +1,8 @@ #' Add custom index support for a tsibble #' +#' @description +#' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("maturing")} +#' #' S3 method to add an index type support for a tsibble. #' #' @param x An object of index type that the tsibble supports. diff --git a/R/new-data.R b/R/new-data.R index 0bb47412..cbac8844 100644 --- a/R/new-data.R +++ b/R/new-data.R @@ -53,8 +53,6 @@ new_data.tbl_ts <- function(.data, n = 1L, keep_all = FALSE, ...) { } #' @description -#' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("maturing")} -#' #' `append_row()`: add new rows to the end of a tsibble by filling a key-index #' pair and `NA` for measured variables. #' diff --git a/R/period.R b/R/period.R index 4c8ac52c..403ebf8d 100644 --- a/R/period.R +++ b/R/period.R @@ -603,6 +603,9 @@ as.POSIXlt.yearquarter <- function(x, tz = "", ...) { #' Time units since Unix Epoch #' +#' @description +#' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("questioning")} +#' #' @param x An object of `POSIXct`, `Date`, `yearweek`, `yearmonth`, `yearquarter`. #' #' @details diff --git a/R/slide.R b/R/slide.R index 84021c99..369ca221 100644 --- a/R/slide.R +++ b/R/slide.R @@ -19,6 +19,9 @@ replace_fn_names <- function(fn, replace = list(), ns = NULL) { #' Sliding window calculation #' +#' @description +#' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} +#' #' Rolling window with overlapping observations: #' * `slide()` always returns a list. #' * `slide_lgl()`, `slide_int()`, `slide_dbl()`, `slide_chr()` use the same @@ -123,6 +126,9 @@ slide_dfc <- function(.x, .f, ..., .size = 1, .step = 1, .fill = NA, #' Sliding window calculation over multiple inputs simultaneously #' +#' @description +#' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} +#' #' Rolling window with overlapping observations: #' * `slide2()` and `pslide()` always returns a list. #' * `slide2_lgl()`, `slide2_int()`, `slide2_dbl()`, `slide2_chr()` use the same diff --git a/R/stretch.R b/R/stretch.R index 2f88882d..e6b231dc 100644 --- a/R/stretch.R +++ b/R/stretch.R @@ -5,6 +5,9 @@ nrow2 <- function(.x) { #' Stretching window calculation #' +#' @description +#' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} +#' #' Fixing an initial window and expanding more observations: #' * `stretch()` always returns a list. #' * `stretch_lgl()`, `stretch_int()`, `stretch_dbl()`, `stretch_chr()` use the same @@ -78,6 +81,9 @@ stretch_dfc <- function(.x, .f, ..., .step = 1, .init = 1, .fill = NA, #' Stretching window calculation over multiple simultaneously #' +#' @description +#' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} +#' #' Fixing an initial window and expanding more observations: #' * `stretch2()` and `pstretch()` always returns a list. #' * `stretch2_lgl()`, `stretch2_int()`, `stretch2_dbl()`, `stretch2_chr()` use the same diff --git a/R/tile.R b/R/tile.R index 4df0b4ce..8a395cd2 100644 --- a/R/tile.R +++ b/R/tile.R @@ -1,5 +1,8 @@ #' Tiling window calculation #' +#' @description +#' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} +#' #' Tiling window without overlapping observations: #' * `tile()` always returns a list. #' * `tile_lgl()`, `tile_int()`, `tile_dbl()`, `tile_chr()` use the same @@ -54,6 +57,9 @@ tile_dfc <- function(.x, .f, ..., .size = 1, .bind = FALSE) { #' Tiling window calculation over multiple inputs simultaneously #' +#' @description +#' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} +#' #' Tiling window without overlapping observations: #' * `tile2()` and `ptile()` always returns a list. #' * `tile2_lgl()`, `tile2_int()`, `tile2_dbl()`, `tile2_chr()` use the same diff --git a/R/time-wise.R b/R/time-wise.R index 31d9d2ab..8153ac26 100644 --- a/R/time-wise.R +++ b/R/time-wise.R @@ -1,5 +1,8 @@ #' Lagged differences #' +#' @description +#' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} +#' #' @param x A numeric vector. #' @param lag An positive integer indicating which lag to use. #' @param differences An positive integer indicating the order of the difference. diff --git a/R/tsibble-meta.R b/R/tsibble-meta.R index fa28a3c7..8d74eb53 100644 --- a/R/tsibble-meta.R +++ b/R/tsibble-meta.R @@ -100,6 +100,10 @@ is_ordered <- function(x) { #' If the object is a tsibble #' +#' @description +#' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} +#' +#' #' @param x An object. #' #' @return TRUE if the object inherits from the tbl_ts class. diff --git a/R/tsibble2ts.R b/R/tsibble2ts.R index 5589fa10..ae2e4f3f 100644 --- a/R/tsibble2ts.R +++ b/R/tsibble2ts.R @@ -114,6 +114,9 @@ time.POSIXt <- function(x, frequency = NULL, ...) { #' Guess a time frequency from other index objects #' +#' @description +#' \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} +#' #' A possible frequency passed to the `ts()` function #' #' @param x An index object including "yearmonth", "yearquarter", "Date" and others. diff --git a/README.Rmd b/README.Rmd index cbc42a61..922ab21f 100644 --- a/README.Rmd +++ b/README.Rmd @@ -12,7 +12,7 @@ output: [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/tidyverts/tsibble?branch=master&svg=true)](https://ci.appveyor.com/project/tidyverts/tsibble) [![Coverage Status](https://codecov.io/gh/tidyverts/tsibble/branch/master/graph/badge.svg)](https://codecov.io/github/tidyverts/tsibble?branch=master) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/tsibble)](https://cran.r-project.org/package=tsibble) -[![Downloads](http://cranlogs.r-pkg.org/badges/tsibble?color=brightgreen)](https://cran.r-project.org/package=tsibble) +[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing) ```{r, echo = FALSE} knitr::opts_chunk$set( diff --git a/README.md b/README.md index 1f259f09..dda7a802 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,8 @@ Status](https://ci.appveyor.com/api/projects/status/github/tidyverts/tsibble?bra [![Coverage Status](https://codecov.io/gh/tidyverts/tsibble/branch/master/graph/badge.svg)](https://codecov.io/github/tidyverts/tsibble?branch=master) [![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/tsibble)](https://cran.r-project.org/package=tsibble) -[![Downloads](http://cranlogs.r-pkg.org/badges/tsibble?color=brightgreen)](https://cran.r-project.org/package=tsibble) +[![Lifecycle: +maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing) The **tsibble** package provides a data infrastructure for tidy temporal data with wrangling tools. Adhering to the [tidy data diff --git a/man/build_tsibble.Rd b/man/build_tsibble.Rd index 98643446..d7c02c7f 100644 --- a/man/build_tsibble.Rd +++ b/man/build_tsibble.Rd @@ -36,6 +36,8 @@ are sure that it's a valid input, specify \code{FALSE} to skip the checks.} \item{.drop}{If \code{TRUE}, empty key groups are dropped.} } \description{ +\Sexpr[results=rd, stage=render]{tsibble:::lifecycle("maturing")} + \code{build_tsibble()} creates a \code{tbl_ts} object with more controls. It is useful for creating a \code{tbl_ts} internally inside a function, and it allows developers to determine if the time needs ordering and the interval needs calculating. diff --git a/man/build_tsibble_meta.Rd b/man/build_tsibble_meta.Rd index 530a7a08..7a236ddd 100644 --- a/man/build_tsibble_meta.Rd +++ b/man/build_tsibble_meta.Rd @@ -23,6 +23,8 @@ the correct order. \code{FALSE} checks the ordering and may give a warning.} irregular interval. Use the specified interval via \code{\link[=new_interval]{new_interval()}} as is.} } \description{ +\Sexpr[results=rd, stage=render]{tsibble:::lifecycle("experimental")} + \code{build_tsibble_meta()} does much less checks than \code{build_tsibble()} for high performance. } diff --git a/man/difference.Rd b/man/difference.Rd index 56d34c9b..a056b6ae 100644 --- a/man/difference.Rd +++ b/man/difference.Rd @@ -22,7 +22,7 @@ difference(x, lag = 1, differences = 1, default = NA, A numeric vector of the same length as \code{x}. } \description{ -Lagged differences +\Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} } \examples{ # examples from base diff --git a/man/duplicates.Rd b/man/duplicates.Rd index fdb8c7d7..b6f20c6a 100644 --- a/man/duplicates.Rd +++ b/man/duplicates.Rd @@ -24,6 +24,7 @@ empty key, and works with tidy selector (e.g. \code{\link[dplyr:starts_with]{dpl elements.} } \description{ +\Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} \itemize{ \item \code{is_duplicated()}: a logical scalar if the data exist duplicated observations. \item \code{are_duplicated()}: a logical vector, the same length as the row number of \code{data}. diff --git a/man/group_by_key.Rd b/man/group_by_key.Rd index 83f9f6ca..9160b541 100644 --- a/man/group_by_key.Rd +++ b/man/group_by_key.Rd @@ -15,7 +15,7 @@ group_by_key(.data, ..., .drop = key_drop_default(.data)) what the default value is for this argument.} } \description{ -Group by key variables +\Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} } \examples{ tourism \%>\% diff --git a/man/guess_frequency.Rd b/man/guess_frequency.Rd index c4d50944..1c2b249c 100644 --- a/man/guess_frequency.Rd +++ b/man/guess_frequency.Rd @@ -10,6 +10,8 @@ guess_frequency(x) \item{x}{An index object including "yearmonth", "yearquarter", "Date" and others.} } \description{ +\Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} + A possible frequency passed to the \code{ts()} function } \details{ diff --git a/man/index-by.Rd b/man/index-by.Rd index aa97b2e1..0112067f 100644 --- a/man/index-by.Rd +++ b/man/index-by.Rd @@ -28,6 +28,7 @@ fine-resolution aggregation } \description{ \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} + \code{index_by()} is the counterpart of \code{group_by()} in temporal context, but it only groups the time index. The following operation is applied to each partition of the index, similar to \code{group_by()} but dealing with index only. diff --git a/man/index_valid.Rd b/man/index_valid.Rd index 040e3294..51be4e73 100644 --- a/man/index_valid.Rd +++ b/man/index_valid.Rd @@ -13,6 +13,8 @@ index_valid(x) \code{TRUE}/\code{FALSE} or \code{NA} (unsure) } \description{ +\Sexpr[results=rd, stage=render]{tsibble:::lifecycle("maturing")} + S3 method to add an index type support for a tsibble. } \details{ diff --git a/man/is-tsibble.Rd b/man/is-tsibble.Rd index 416723b1..861e3565 100644 --- a/man/is-tsibble.Rd +++ b/man/is-tsibble.Rd @@ -18,7 +18,7 @@ is_grouped_ts(x) TRUE if the object inherits from the tbl_ts class. } \description{ -If the object is a tsibble +\Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} } \examples{ # A tibble is not a tsibble ---- diff --git a/man/new-data.Rd b/man/new-data.Rd index 748bc698..7b1cb075 100644 --- a/man/new-data.Rd +++ b/man/new-data.Rd @@ -26,8 +26,6 @@ and key, otherwise only index and key.} \description{ \Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} -\Sexpr[results=rd, stage=render]{tsibble:::lifecycle("maturing")} - \code{append_row()}: add new rows to the end of a tsibble by filling a key-index pair and \code{NA} for measured variables. diff --git a/man/new_tsibble.Rd b/man/new_tsibble.Rd index 3476bc0b..7ceb704e 100644 --- a/man/new_tsibble.Rd +++ b/man/new_tsibble.Rd @@ -14,5 +14,5 @@ new_tsibble(x, ..., class = NULL) \item{class}{Subclasses to assign to the new object, default: none.} } \description{ -Create a subclass of a tsibble +\Sexpr[results=rd, stage=render]{tsibble:::lifecycle("maturing")} } diff --git a/man/slide.Rd b/man/slide.Rd index 4e1c7006..33491d27 100644 --- a/man/slide.Rd +++ b/man/slide.Rd @@ -69,6 +69,8 @@ Only applies to \code{_dfr} variant.} if \code{.fill != NULL}, it always returns the same length as input. } \description{ +\Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} + Rolling window with overlapping observations: \itemize{ \item \code{slide()} always returns a list. diff --git a/man/slide2.Rd b/man/slide2.Rd index b81ed588..27c2e822 100644 --- a/man/slide2.Rd +++ b/man/slide2.Rd @@ -82,6 +82,8 @@ determines the number of arguments that \code{.f} will be called with. List names will be used if present.} } \description{ +\Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} + Rolling window with overlapping observations: \itemize{ \item \code{slide2()} and \code{pslide()} always returns a list. diff --git a/man/stretch.Rd b/man/stretch.Rd index d331fe89..c0fe1839 100644 --- a/man/stretch.Rd +++ b/man/stretch.Rd @@ -61,6 +61,8 @@ Only applies to \code{_dfr} variant.} if \code{.fill != NULL}, it always returns the same length as input. } \description{ +\Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} + Fixing an initial window and expanding more observations: \itemize{ \item \code{stretch()} always returns a list. diff --git a/man/stretch2.Rd b/man/stretch2.Rd index 0dc0cd33..ae756dd3 100644 --- a/man/stretch2.Rd +++ b/man/stretch2.Rd @@ -77,6 +77,8 @@ determines the number of arguments that \code{.f} will be called with. List names will be used if present.} } \description{ +\Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} + Fixing an initial window and expanding more observations: \itemize{ \item \code{stretch2()} and \code{pstretch()} always returns a list. diff --git a/man/tile.Rd b/man/tile.Rd index f8d9ff0c..47b82fe3 100644 --- a/man/tile.Rd +++ b/man/tile.Rd @@ -51,6 +51,8 @@ variable will be created. Only applies to \code{_dfr} variant.} } \description{ +\Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} + Tiling window without overlapping observations: \itemize{ \item \code{tile()} always returns a list. diff --git a/man/tile2.Rd b/man/tile2.Rd index 899ad190..bcc25460 100644 --- a/man/tile2.Rd +++ b/man/tile2.Rd @@ -66,6 +66,8 @@ determines the number of arguments that \code{.f} will be called with. List names will be used if present.} } \description{ +\Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} + Tiling window without overlapping observations: \itemize{ \item \code{tile2()} and \code{ptile()} always returns a list. diff --git a/man/time_in.Rd b/man/time_in.Rd index eece9932..5233b74a 100644 --- a/man/time_in.Rd +++ b/man/time_in.Rd @@ -23,6 +23,8 @@ Supported index type: \code{POSIXct} (to seconds), \code{Date}, \code{yearweek}, logical vector } \description{ +\Sexpr[results=rd, stage=render]{tsibble:::lifecycle("maturing")} + This function respects time zone and encourages compact expressions. } \section{System Time Zone ("Europe/London")}{ diff --git a/man/tsibble.Rd b/man/tsibble.Rd index cd3a9e82..a2256139 100644 --- a/man/tsibble.Rd +++ b/man/tsibble.Rd @@ -24,7 +24,7 @@ interval is determined by the greatest common divisor of index column, if \code{ A tsibble object. } \description{ -Create a tsibble object +\Sexpr[results=rd, stage=render]{tsibble:::lifecycle("stable")} } \details{ A tsibble is sorted by its key first and index. diff --git a/man/units_since.Rd b/man/units_since.Rd index fad84a1a..e1e28fa6 100644 --- a/man/units_since.Rd +++ b/man/units_since.Rd @@ -10,7 +10,7 @@ units_since(x) \item{x}{An object of \code{POSIXct}, \code{Date}, \code{yearweek}, \code{yearmonth}, \code{yearquarter}.} } \description{ -Time units since Unix Epoch +\Sexpr[results=rd, stage=render]{tsibble:::lifecycle("questioning")} } \details{ origin: diff --git a/man/update_tsibble.Rd b/man/update_tsibble.Rd index ae9d4927..f36ffb8f 100644 --- a/man/update_tsibble.Rd +++ b/man/update_tsibble.Rd @@ -25,7 +25,7 @@ are sure that it's a valid input, specify \code{FALSE} to skip the checks.} \item{.drop}{If \code{TRUE}, empty key groups are dropped.} } \description{ -Update key and index for a tsibble +\Sexpr[results=rd, stage=render]{tsibble:::lifecycle("maturing")} } \details{ Unspecified arguments will inherit the attributes from \code{x}.