From 2fe99f9f9cf9465e1fced2fdfd1e93969b122197 Mon Sep 17 00:00:00 2001 From: earowang Date: Thu, 11 Oct 2018 06:37:20 +1100 Subject: [PATCH] cran release #65 --- DESCRIPTION | 4 +- NAMESPACE | 1 - NEWS.md | 4 +- _pkgdown.yml | 2 +- docs/CODE_OF_CONDUCT.html | 2 +- docs/CONTRIBUTING.html | 2 +- docs/ISSUE_TEMPLATE.html | 2 +- docs/LICENSE.html | 2 +- docs/SUPPORT.html | 2 +- docs/articles/index.html | 2 +- docs/articles/intro-tsibble.html | 4 +- docs/articles/window.html | 12 +- docs/authors.html | 2 +- docs/index.html | 2 +- docs/news/index.html | 89 ++++++---- docs/reference/append-row.html | 247 ++++++++++++++++++++++++++++ docs/reference/as-tibble.html | 2 +- docs/reference/as-tsibble.html | 138 ++++++++-------- docs/reference/as.ts.tbl_ts.html | 2 +- docs/reference/build_tsibble.html | 2 +- docs/reference/case_na.html | 8 +- docs/reference/difference.html | 20 +-- docs/reference/fill-na.html | 88 +++++----- docs/reference/find_duplicates.html | 2 +- docs/reference/gaps.html | 5 +- docs/reference/group_by_key.html | 2 +- docs/reference/guess_frequency.html | 2 +- docs/reference/holiday_aus.html | 2 +- docs/reference/id.html | 2 +- docs/reference/index-by.html | 2 +- docs/reference/index-rd.html | 2 +- docs/reference/index.html | 18 +- docs/reference/index_valid.html | 2 +- docs/reference/is-tsibble.html | 2 +- docs/reference/key-size.html | 2 +- docs/reference/key.html | 2 +- docs/reference/key_sum.html | 2 +- docs/reference/key_update.html | 2 +- docs/reference/measured-vars.html | 2 +- docs/reference/new_interval.html | 2 +- docs/reference/pedestrian.html | 2 +- docs/reference/period.html | 34 +--- docs/reference/pull-interval.html | 2 +- docs/reference/reexports.html | 2 +- docs/reference/regular.html | 4 +- docs/reference/slide.html | 2 +- docs/reference/slide2.html | 40 ++--- docs/reference/slider.html | 2 +- docs/reference/split-by.html | 2 +- docs/reference/stretch.html | 2 +- docs/reference/stretch2.html | 2 +- docs/reference/stretcher.html | 2 +- docs/reference/tidyverse.html | 58 +++---- docs/reference/tile.html | 2 +- docs/reference/tile2.html | 2 +- docs/reference/tiler.html | 2 +- docs/reference/time_unit.html | 2 +- docs/reference/tourism.html | 2 +- docs/reference/tsibble-package.html | 67 ++++---- docs/reference/tsibble.html | 67 ++++---- docs/reference/units_since.html | 2 +- docs/sitemap.xml | 3 + revdep/checks.rds | Bin 731 -> 846 bytes 63 files changed, 623 insertions(+), 372 deletions(-) create mode 100644 docs/reference/append-row.html diff --git a/DESCRIPTION b/DESCRIPTION index f4969880..16108de3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: tsibble Title: Tidy Temporal Data Frames and Tools -Version: 0.5.2.9000 -Date: 2018-09-11 +Version: 0.5.3 +Date: 2018-10-10 Authors@R: c( person("Earo", "Wang", email = "earo.wang@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-6448-5260")), person("Di", "Cook", role = c("aut", "ths"), comment = c(ORCID = "0000-0002-3813-7155")), diff --git a/NAMESPACE b/NAMESPACE index da603af3..13b5775f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -237,7 +237,6 @@ export(index_valid) export(inner_join) export(interval) export(is.grouped_ts) -export(is.regular) export(is.tsibble) export(is_53weeks) export(is_grouped_ts) diff --git a/NEWS.md b/NEWS.md index 89399dc3..22b69bd6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# tsibble 0.5.2.9000 +# tsibble 0.5.3 ## New features @@ -13,7 +13,7 @@ ## Misc -* Soft-deprecated `case_na()`. +* Soft-deprecated `case_na()` & `split_by()`. # tsibble 0.5.2 diff --git a/_pkgdown.yml b/_pkgdown.yml index a74d4723..71494816 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -43,8 +43,8 @@ reference: - index_by - fill_na - count_gaps + - append_row - group_by_key - - split_by - find_duplicates - title: A family of window functions diff --git a/docs/CODE_OF_CONDUCT.html b/docs/CODE_OF_CONDUCT.html index caf1bc65..3047b75b 100644 --- a/docs/CODE_OF_CONDUCT.html +++ b/docs/CODE_OF_CONDUCT.html @@ -77,7 +77,7 @@ tsibble - 0.5.2.9000 + 0.5.3 diff --git a/docs/CONTRIBUTING.html b/docs/CONTRIBUTING.html index a6e4fdf0..86753449 100644 --- a/docs/CONTRIBUTING.html +++ b/docs/CONTRIBUTING.html @@ -77,7 +77,7 @@ tsibble - 0.5.2.9000 + 0.5.3 diff --git a/docs/ISSUE_TEMPLATE.html b/docs/ISSUE_TEMPLATE.html index 669b7cfe..8a48a6ea 100644 --- a/docs/ISSUE_TEMPLATE.html +++ b/docs/ISSUE_TEMPLATE.html @@ -77,7 +77,7 @@ tsibble - 0.5.2.9000 + 0.5.3 diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 3665936f..546bf2dd 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -77,7 +77,7 @@ tsibble - 0.5.2.9000 + 0.5.3 diff --git a/docs/SUPPORT.html b/docs/SUPPORT.html index c3a1ac1b..85bf19bd 100644 --- a/docs/SUPPORT.html +++ b/docs/SUPPORT.html @@ -77,7 +77,7 @@ tsibble - 0.5.2.9000 + 0.5.3 diff --git a/docs/articles/index.html b/docs/articles/index.html index 73dafe0b..4df358a9 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -77,7 +77,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/articles/intro-tsibble.html b/docs/articles/intro-tsibble.html index 733dca6b..edb6b23a 100644 --- a/docs/articles/intro-tsibble.html +++ b/docs/articles/intro-tsibble.html @@ -38,7 +38,7 @@ tsibble - 0.5.2 + 0.5.3 @@ -123,7 +123,7 @@

#> # ... with 2.611e+04 more rows

The weather data included in the package nycflights13 contains the hourly meteorological records (such as temperature, humid and precipitation) over the year of 2013 at three stations (i.e. JFK, LGA and EWR) in New York City. Since the time_hour is the only one column consisting of the timestamps, as_tsibble() detects it as the index variable; alternatively, it would be more verbose to specify the argument index = time_hour. A tsibble is comprised of an index and key variables. In this case, the origin variable is the identifier created via id() and passed to the key argument in as_tsibble(). Therefore, the key together with the index uniquely identifies each observation, which gives a valid tsibble. Others—temp, humid and precip—are considered as measured variables.

weather_tsbl <- as_tsibble(weather, key = id(origin))
-
#> The `index` is `time_hour`.
+
#> Column `time_hour` is the index.
#> # A tsibble: 26,115 x 5 [1h]
 #> # Key:       origin [3]
diff --git a/docs/articles/window.html b/docs/articles/window.html
index b1de3e5c..0e279111 100644
--- a/docs/articles/window.html
+++ b/docs/articles/window.html
@@ -38,7 +38,7 @@
       
       
         tsibble
-        0.5.2
+        0.5.3
       
     
 
@@ -161,7 +161,7 @@ 

pedestrian_mth #> # A tibble: 96 x 3 #> Sensor YrMth data -#> * <chr> <mth> <list> +#> <chr> <mth> <list> #> 1 Birrarung Marr 2015 Jan <tsibble [744 × 4]> #> 2 Birrarung Marr 2015 Feb <tsibble [672 × 4]> #> 3 Birrarung Marr 2015 Mar <tsibble [744 × 4]> @@ -182,7 +182,7 @@

#> # A tibble: 96 x 4 #> # Groups: Sensor [4] #> Sensor YrMth data Monthly_MA -#> * <chr> <mth> <list> <dbl> +#> <chr> <mth> <list> <dbl> #> 1 Birrarung Marr 2015 Jan <tsibble [744 × 4]> NA #> 2 Birrarung Marr 2015 Feb <tsibble [672 × 4]> 634. #> 3 Birrarung Marr 2015 Mar <tsibble [744 × 4]> 546. @@ -195,17 +195,17 @@

Row-oriented workflow

We have had a glimpse at row-oriented workflow to slide over consecutive months using nest() in the preceding example. To leverage this workflow more, we can fit a linear model for each sensor simultaneously but independently, and in turn obtain its fitted values and residuals over weekly rolling windows. This is where pslide() comes to play. It takes a list or a data frame (multiple inputs) and apply the custom function my_diag() to every rolling block. We start with a tsibble and end up with a diagnostic tibble of relatively larger size.

diff --git a/docs/index.html b/docs/index.html index 15bb6e19..2aea6034 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,7 @@ tsibble - 0.5.2.9000 + 0.5.3 diff --git a/docs/news/index.html b/docs/news/index.html index 433ca460..e45ed2d1 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -77,7 +77,7 @@ tsibble - 0.5.2 + 0.5.3 @@ -135,14 +135,44 @@

Changelog

-
+

-tsibble 0.5.2 2018-09-11 +tsibble 0.5.3 2018-10-10

+
+

+New features

+
    +
  • Added append_row() for easily appending new observations to a tsibble. (#59)
  • +
  • Nesting structure can be specified using /, consistent with lm. (#64)
  • +
+

Bug fixes

    +
  • Fixed warning in fill_na() for multiple replacements when using with group_by(), introduced in v0.5.1.
  • +
  • +as_tsibble.grouped_df() respected its existing groups and removed argument group. (#60)
  • +
  • Preserve the ordering of key specification in select.tbl_ts(). (#63)
  • +
+
+
+

+Misc

+ +
+
+
+

+tsibble 0.5.2 2018-09-11 +

+
+

+Bug fixes

+
  • unnest.lst_ts respects the ordering of “key” values. (#56)
  • @@ -175,9 +205,9 @@

    tsibble 0.5.1 2018-08-20

    -
    +

    -New features

    +New features

  • tile() gained a new argument .bind = FALSE.
  • @@ -194,9 +224,9 @@

  • Speed improvement when subsetting yearweek, yearmonth and yearquarter using [.
-
+

-Bug fixes

+Bug fixes
  • Fixed key updating via group_by() + summarise(). (#47)
  • Respected the ordering of input variables while creating the key.
  • @@ -205,9 +235,9 @@

  • Avoided warnings when character input for key and value in gather.tbl_ts(). (#54)
-
+

-Misc

+Misc
  • slide() & stretch() use the same coercion rules as dplyr::combine() now, if .bind = TRUE.
  • @@ -221,9 +251,9 @@

    tsibble 0.5.0 2018-08-05

    This release introduced the breaking changes to the “interval” class to make tsibble better support finer time resolution (e.g. millisecond, microsecond, and nanosecond). The “interval” format changes from upper case to short hand. To support new time index class, only index_valid() and pull_interval() need to be defined now.

    -
    +

    -New features

    +New features
    • Added “nanotime” support for nanoseconds.
    • Added scoped variant group_by_key() to easily group the key variables.
    • @@ -253,9 +283,9 @@

      time_unit() is a function instead of S3 generic, and made index extension a bit easier.

    -
    +

    -Bug fixes

    +Bug fixes
    • Fixed warning in format.yearweek().
    • Fixed group_by.lst_ts() for dropping the grouping information.
    • @@ -264,9 +294,9 @@

    • Fixed bug in .fill = NULL for slide().
    -
    +

    -Misc

    +Misc
    • Moved package “timeDate” from Imports to Suggests.
    • Added “anytime” to Imports for better parsing characters.
    • @@ -297,9 +327,9 @@

      pslider(), ptiler(), pstretcher() support multiple inputs now, and split them in parallel.

    -
    +

    -New features

    +New features
    • New holiday_aus() for Australian national and state-based public holiday.
    • Defined diff() for year-week, year-month, and year-quarter.
    • @@ -328,9 +358,9 @@

      select.tbl_ts() now preserved index.

    -
    +

    -Bug fixes

    +Bug fixes
    • Fixed bug in as.ts.tbl_ts() for ignoring the value argument when the key is empty.
    • Fixed bug in [.tbl_ts() when subsetting columns by characters (#30).
    • @@ -339,9 +369,9 @@

    • If a column passed as index contains NA, abort.
    -
    +

    -Misc

    +Misc
    • Suggested on nycflights13 >= 1.0.0.
    @@ -439,9 +469,9 @@

  • Slightly improved the speed of fill_na().
-
+

-Bug fixes

+Bug fixes
-
+

-Bug fixes

+Bug fixes
  • Fixed as_tsibble.ts() for daily time series (when frequency = 7).
  • @@ -531,9 +561,9 @@

  • Depends on purrr (>= 0.2.3)
-
+

-Bug fixes

+Bug fixes
  • Fixed the error message in glimpse.tbl_ts()
  • @@ -564,9 +594,9 @@

    inform_duplicates() informs which row has duplicated elements of key and index variables.

-
+

-Bug fixes

+Bug fixes
  • Fix bug in summarise.tbl_ts() and tsummarise.tbl_ts(), when calling functions with no parameters like dplyr::n().
  • In summarise.tbl_ts() and tsummarise.tbl_ts(), one grouping level should be dropped for the consistency with dplyr::summarise() for a grouped tbl_ts.
  • @@ -609,6 +639,7 @@

    Contents

    diff --git a/docs/reference/as-tsibble.html b/docs/reference/as-tsibble.html index d8c6d667..ff2a09a1 100644 --- a/docs/reference/as-tsibble.html +++ b/docs/reference/as-tsibble.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3

@@ -231,70 +231,70 @@

See a

Examples

# coerce tibble to tsibble w/o a key ---- tbl1 <- tibble( - date = seq(as.Date("2017-01-01"), as.Date("2017-01-10"), by = 1), + date = as.Date("2017-01-01") + 0:9, value = rnorm(10) ) -as_tsibble(tbl1)
#> The `index` is `date`.
#> # A tsibble: 10 x 2 [1D] -#> date value -#> <date> <dbl> -#> 1 2017-01-01 -1.40 -#> 2 2017-01-02 0.255 -#> 3 2017-01-03 -2.44 -#> 4 2017-01-04 -0.00557 -#> 5 2017-01-05 0.622 -#> 6 2017-01-06 1.15 -#> 7 2017-01-07 -1.82 -#> 8 2017-01-08 -0.247 -#> 9 2017-01-09 -0.244 -#> 10 2017-01-10 -0.283
# specify the index var +as_tsibble(tbl1)
#> Column `date` is the index.
#> # A tsibble: 10 x 2 [1D] +#> date value +#> <date> <dbl> +#> 1 2017-01-01 -1.82 +#> 2 2017-01-02 -0.247 +#> 3 2017-01-03 -0.244 +#> 4 2017-01-04 -0.283 +#> 5 2017-01-05 -0.554 +#> 6 2017-01-06 0.629 +#> 7 2017-01-07 2.07 +#> 8 2017-01-08 -1.63 +#> 9 2017-01-09 0.512 +#> 10 2017-01-10 -1.86
# specify the index var as_tsibble(tbl1, index = date)
#> # A tsibble: 10 x 2 [1D] -#> date value -#> <date> <dbl> -#> 1 2017-01-01 -1.40 -#> 2 2017-01-02 0.255 -#> 3 2017-01-03 -2.44 -#> 4 2017-01-04 -0.00557 -#> 5 2017-01-05 0.622 -#> 6 2017-01-06 1.15 -#> 7 2017-01-07 -1.82 -#> 8 2017-01-08 -0.247 -#> 9 2017-01-09 -0.244 -#> 10 2017-01-10 -0.283
+#> date value +#> <date> <dbl> +#> 1 2017-01-01 -1.82 +#> 2 2017-01-02 -0.247 +#> 3 2017-01-03 -0.244 +#> 4 2017-01-04 -0.283 +#> 5 2017-01-05 -0.554 +#> 6 2017-01-06 0.629 +#> 7 2017-01-07 2.07 +#> 8 2017-01-08 -1.63 +#> 9 2017-01-09 0.512 +#> 10 2017-01-10 -1.86
# coerce tibble to tsibble with one key ---- # "date" is automatically considered as the index var, and "group" is the key tbl2 <- tibble( - mth = rep(yearmonth(seq(2017, 2017 + 9 / 12, by = 1 / 12)), 3), + mth = rep(yearmonth("201701") + 0:9, 3), group = rep(c("x", "y", "z"), each = 10), value = rnorm(30) ) -as_tsibble(tbl2, key = id(group))
#> The `index` is `mth`.
#> # A tsibble: 30 x 3 [1M] +as_tsibble(tbl2, key = id(group))
#> Column `mth` is the index.
#> # A tsibble: 30 x 3 [1M] #> # Key: group [3] #> mth group value #> <mth> <chr> <dbl> -#> 1 2017 Jan x -0.554 -#> 2 2017 Feb x 0.629 -#> 3 2017 Mar x 2.07 -#> 4 2017 Apr x -1.63 -#> 5 2017 May x 0.512 -#> 6 2017 Jun x -1.86 -#> 7 2017 Jul x -0.522 -#> 8 2017 Aug x -0.0526 -#> 9 2017 Sep x 0.543 -#> 10 2017 Oct x -0.914 +#> 1 2017 Jan x -0.522 +#> 2 2017 Feb x -0.0526 +#> 3 2017 Mar x 0.543 +#> 4 2017 Apr x -0.914 +#> 5 2017 May x 0.468 +#> 6 2017 Jun x 0.363 +#> 7 2017 Jul x -1.30 +#> 8 2017 Aug x 0.738 +#> 9 2017 Sep x 1.89 +#> 10 2017 Oct x -0.0974 #> # ... with 20 more rows
as_tsibble(tbl2, key = id(group), index = mth)
#> # A tsibble: 30 x 3 [1M] #> # Key: group [3] #> mth group value #> <mth> <chr> <dbl> -#> 1 2017 Jan x -0.554 -#> 2 2017 Feb x 0.629 -#> 3 2017 Mar x 2.07 -#> 4 2017 Apr x -1.63 -#> 5 2017 May x 0.512 -#> 6 2017 Jun x -1.86 -#> 7 2017 Jul x -0.522 -#> 8 2017 Aug x -0.0526 -#> 9 2017 Sep x 0.543 -#> 10 2017 Oct x -0.914 +#> 1 2017 Jan x -0.522 +#> 2 2017 Feb x -0.0526 +#> 3 2017 Mar x 0.543 +#> 4 2017 Apr x -0.914 +#> 5 2017 May x 0.468 +#> 6 2017 Jun x 0.363 +#> 7 2017 Jul x -1.30 +#> 8 2017 Aug x 0.738 +#> 9 2017 Sep x 1.89 +#> 10 2017 Oct x -0.0974 #> # ... with 20 more rows
# coerce ts to tsibble as_tsibble(AirPassengers)
#> # A tsibble: 144 x 2 [1M] @@ -356,29 +356,29 @@

Examp #> # Key: key [3] #> index key value #> <mth> <chr> <dbl> -#> 1 1961 Jan Series 1 0.0700 -#> 2 1961 Feb Series 1 -0.639 -#> 3 1961 Mar Series 1 -0.0500 -#> 4 1961 Apr Series 1 -0.251 -#> 5 1961 May Series 1 0.445 -#> 6 1961 Jun Series 1 2.76 -#> 7 1961 Jul Series 1 0.0465 -#> 8 1961 Aug Series 1 0.578 -#> 9 1961 Sep Series 1 0.118 -#> 10 1961 Oct Series 1 -1.91 +#> 1 1961 Jan Series 1 0.0465 +#> 2 1961 Feb Series 1 0.578 +#> 3 1961 Mar Series 1 0.118 +#> 4 1961 Apr Series 1 -1.91 +#> 5 1961 May Series 1 0.862 +#> 6 1961 Jun Series 1 -0.243 +#> 7 1961 Jul Series 1 -0.206 +#> 8 1961 Aug Series 1 0.0192 +#> 9 1961 Sep Series 1 0.0296 +#> 10 1961 Oct Series 1 0.550 #> # ... with 290 more rows

as_tsibble(z, gather = FALSE)
#> # A tsibble: 100 x 4 [1M] #> index `Series 1` `Series 2` `Series 3` #> <mth> <dbl> <dbl> <dbl> -#> 1 1961 Jan 0.0700 -0.163 -0.903 -#> 2 1961 Feb -0.639 -0.827 1.32 -#> 3 1961 Mar -0.0500 1.88 1.10 -#> 4 1961 Apr -0.251 0.766 1.20 -#> 5 1961 May 0.445 0.980 -1.43 -#> 6 1961 Jun 2.76 1.32 1.38 -#> 7 1961 Jul 0.0465 -1.12 0.00313 -#> 8 1961 Aug 0.578 0.515 -0.0779 -#> 9 1961 Sep 0.118 -1.51 0.441 -#> 10 1961 Oct -1.91 1.53 0.129 +#> 1 1961 Jan 0.0465 -1.12 0.00313 +#> 2 1961 Feb 0.578 0.515 -0.0779 +#> 3 1961 Mar 0.118 -1.51 0.441 +#> 4 1961 Apr -1.91 1.53 0.129 +#> 5 1961 May 0.862 0.429 -0.830 +#> 6 1961 Jun -0.243 0.122 -0.504 +#> 7 1961 Jul -0.206 -1.14 -1.19 +#> 8 1961 Aug 0.0192 -0.558 -0.752 +#> 9 1961 Sep 0.0296 1.05 1.46 +#> 10 1961 Oct 0.550 0.678 -0.829 #> # ... with 90 more rows
# coerce hts from the "hts" package to tsibble if (!requireNamespace("hts", quietly = TRUE)) { diff --git a/docs/reference/as.ts.tbl_ts.html b/docs/reference/as.ts.tbl_ts.html index 9e83cbf4..e969890e 100644 --- a/docs/reference/as.ts.tbl_ts.html +++ b/docs/reference/as.ts.tbl_ts.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3
diff --git a/docs/reference/build_tsibble.html b/docs/reference/build_tsibble.html index e33767a4..1f04edc8 100644 --- a/docs/reference/build_tsibble.html +++ b/docs/reference/build_tsibble.html @@ -85,7 +85,7 @@ tsibble - 0.5.2 + 0.5.3
diff --git a/docs/reference/case_na.html b/docs/reference/case_na.html index 354cfde3..f76e19e0 100644 --- a/docs/reference/case_na.html +++ b/docs/reference/case_na.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3
@@ -164,9 +164,9 @@

See a

Examples

x <- rnorm(10) x[c(3, 7)] <- NA_real_ -case_na(x ~ 10)
#> [1] -0.2343379 2.0866886 10.0000000 -1.3928471 -1.1422908 1.7046087 -#> [7] 10.0000000 -0.4372812 -0.1192151 0.7864629
case_na(x ~ mean(x, na.rm = TRUE))
#> [1] -0.2343379 2.0866886 0.1564735 -1.3928471 -1.1422908 1.7046087 -#> [7] 0.1564735 -0.4372812 -0.1192151 0.7864629
+case_na(x ~ 10)
#> [1] -0.08007363 -0.43728124 10.00000000 0.78646286 -0.57894525 -0.14542689 +#> [7] 10.00000000 1.73357811 1.44865722 1.51819315
case_na(x ~ mean(x, na.rm = TRUE))
#> [1] -0.08007363 -0.43728124 0.53064554 0.78646286 -0.57894525 -0.14542689 +#> [7] 0.53064554 1.73357811 1.44865722 1.51819315
@@ -186,17 +186,17 @@

Examp difference(1:10, 2)

#> [1] NA NA 2 2 2 2 2 2 2 2
difference(1:10, 2, 2)
#> [1] NA NA NA NA 0 0 0 0 0 0
x <- cumsum(cumsum(1:10)) difference(x, lag = 2)
#> [1] NA NA 9 16 25 36 49 64 81 100
difference(x, differences = 2)
#> [1] NA NA 3 4 5 6 7 8 9 10
# Use order_by if data not already ordered (example from dplyr) tsbl <- tsibble(year = 2000:2005, value = (0:5) ^ 2, index = year) -scrambled <- tsbl %>% slice(sample(nrow(tsbl)))
#> Warning: The `tbl_ts` is not sorted by `year`.
-wrong <- mutate(scrambled, diff = difference(value))
#> Warning: The `tbl_ts` is not sorted by `year`.
arrange(wrong, year)
#> # A tsibble: 6 x 3 [1Y] +scrambled <- tsbl %>% slice(sample(nrow(tsbl)))
#> Warning: Unexpected temporal order. Please sort by year.
+wrong <- mutate(scrambled, diff = difference(value))
#> Warning: Unexpected temporal order. Please sort by year.
arrange(wrong, year)
#> # A tsibble: 6 x 3 [1Y] #> year value diff #> <int> <dbl> <dbl> -#> 1 2000 0 -4 -#> 2 2001 1 -24 -#> 3 2002 4 -12 -#> 4 2003 9 8 -#> 5 2004 16 7 -#> 6 2005 25 NA
-right <- mutate(scrambled, diff = difference(value, order_by = year))
#> Warning: The `tbl_ts` is not sorted by `year`.
arrange(right, year)
#> # A tsibble: 6 x 3 [1Y] +#> 1 2000 0 -25 +#> 2 2001 1 NA +#> 3 2002 4 -5 +#> 4 2003 9 9 +#> 5 2004 16 15 +#> 6 2005 25 9
+right <- mutate(scrambled, diff = difference(value, order_by = year))
#> Warning: Unexpected temporal order. Please sort by year.
arrange(right, year)
#> # A tsibble: 6 x 3 [1Y] #> year value diff #> <int> <dbl> <dbl> #> 1 2000 0 NA diff --git a/docs/reference/fill-na.html b/docs/reference/fill-na.html index b1938949..ba49e5f3 100644 --- a/docs/reference/fill-na.html +++ b/docs/reference/fill-na.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3
@@ -188,27 +188,27 @@

Examp #> year fruit kilo #> <dbl> <chr> <int> #> 1 2010 cherry NA -#> 2 2011 cherry 3 -#> 3 2012 cherry 2 +#> 2 2011 cherry 1 +#> 3 2012 cherry 3 #> 4 2013 cherry NA -#> 5 2014 cherry 9 -#> 6 2010 kiwi 4 -#> 7 2011 kiwi 5 +#> 5 2014 cherry 6 +#> 6 2010 kiwi 8 +#> 7 2011 kiwi 4 #> 8 2012 kiwi NA -#> 9 2013 kiwi 8 +#> 9 2013 kiwi 10 #> 10 2014 kiwi NA

full_harvest <- fill_na(harvest, .full = FALSE) full_harvest
#> # A tsibble: 8 x 3 [1Y] #> # Key: fruit [2] #> year fruit kilo #> <dbl> <chr> <int> -#> 1 2011 cherry 3 -#> 2 2012 cherry 2 +#> 1 2011 cherry 1 +#> 2 2012 cherry 3 #> 3 2013 cherry NA -#> 4 2014 cherry 9 -#> 5 2010 kiwi 4 -#> 6 2011 kiwi 5 +#> 4 2014 cherry 6 +#> 5 2010 kiwi 8 +#> 6 2011 kiwi 4 #> 7 2012 kiwi NA -#> 8 2013 kiwi 8
+#> 8 2013 kiwi 10
# use fill() to fill `NA` by previous/next entry full_harvest %>% group_by(fruit) %>% @@ -217,42 +217,42 @@

Examp #> # Groups: fruit [2] #> year fruit kilo #> <dbl> <chr> <int> -#> 1 2011 cherry 3 -#> 2 2012 cherry 2 -#> 3 2013 cherry 2 -#> 4 2014 cherry 9 -#> 5 2010 kiwi 4 -#> 6 2011 kiwi 5 -#> 7 2012 kiwi 5 -#> 8 2013 kiwi 8

+#> 1 2011 cherry 1 +#> 2 2012 cherry 3 +#> 3 2013 cherry 3 +#> 4 2014 cherry 6 +#> 5 2010 kiwi 8 +#> 6 2011 kiwi 4 +#> 7 2012 kiwi 4 +#> 8 2013 kiwi 10
# replace NA with a specific value ---- harvest %>% fill_na(kilo = 0L)
#> # A tsibble: 8 x 3 [1Y] #> # Key: fruit [2] #> year fruit kilo #> <dbl> <chr> <int> -#> 1 2011 cherry 3 -#> 2 2012 cherry 2 +#> 1 2011 cherry 1 +#> 2 2012 cherry 3 #> 3 2013 cherry 0 -#> 4 2014 cherry 9 -#> 5 2010 kiwi 4 -#> 6 2011 kiwi 5 +#> 4 2014 cherry 6 +#> 5 2010 kiwi 8 +#> 6 2011 kiwi 4 #> 7 2012 kiwi 0 -#> 8 2013 kiwi 8
+#> 8 2013 kiwi 10
# replace NA using a function by variable ---- harvest %>% fill_na(kilo = sum(kilo))
#> # A tsibble: 8 x 3 [1Y] #> # Key: fruit [2] #> year fruit kilo #> <dbl> <chr> <int> -#> 1 2011 cherry 3 -#> 2 2012 cherry 2 -#> 3 2013 cherry 31 -#> 4 2014 cherry 9 -#> 5 2010 kiwi 4 -#> 6 2011 kiwi 5 -#> 7 2012 kiwi 31 -#> 8 2013 kiwi 8
+#> 1 2011 cherry 1 +#> 2 2012 cherry 3 +#> 3 2013 cherry 32 +#> 4 2014 cherry 6 +#> 5 2010 kiwi 8 +#> 6 2011 kiwi 4 +#> 7 2012 kiwi 32 +#> 8 2013 kiwi 10
# replace NA using a function for each group ---- harvest %>% group_by(fruit) %>% @@ -261,18 +261,18 @@

Examp #> # Groups: fruit [2] #> year fruit kilo #> <dbl> <chr> <int> -#> 1 2011 cherry 3 -#> 2 2012 cherry 2 -#> 3 2013 cherry 14 -#> 4 2014 cherry 9 -#> 5 2010 kiwi 4 -#> 6 2011 kiwi 5 -#> 7 2012 kiwi 17 -#> 8 2013 kiwi 8

+#> 1 2011 cherry 1 +#> 2 2012 cherry 3 +#> 3 2013 cherry 10 +#> 4 2014 cherry 6 +#> 5 2010 kiwi 8 +#> 6 2011 kiwi 4 +#> 7 2012 kiwi 22 +#> 8 2013 kiwi 10
# replace NA ---- pedestrian %>% group_by(Sensor) %>% - fill_na(Count = as.integer(median(Count)))
#> Warning: number of items to replace is not a multiple of replacement length
#> # A tsibble: 69,048 x 5 [1h] + fill_na(Count = as.integer(median(Count)))
#> # A tsibble: 69,048 x 5 [1h] #> # Key: Sensor [4] #> # Groups: Sensor [4] #> Sensor Date_Time Date Time Count diff --git a/docs/reference/find_duplicates.html b/docs/reference/find_duplicates.html index cc01e281..192f5b7d 100644 --- a/docs/reference/find_duplicates.html +++ b/docs/reference/find_duplicates.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3
diff --git a/docs/reference/gaps.html b/docs/reference/gaps.html index c9a9e04b..8b4470b1 100644 --- a/docs/reference/gaps.html +++ b/docs/reference/gaps.html @@ -80,7 +80,7 @@ tsibble - 0.5.2 + 0.5.3 @@ -174,8 +174,7 @@

Arg x, y -

A vector of numbers, dates, or date-times. The length of y must -be greater than the length of x.

+

Atomic vectors. The length of y must be greater than the length of x.

diff --git a/docs/reference/group_by_key.html b/docs/reference/group_by_key.html index 3c4b8b1c..93f042fa 100644 --- a/docs/reference/group_by_key.html +++ b/docs/reference/group_by_key.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/guess_frequency.html b/docs/reference/guess_frequency.html index c6279ca2..0b51e8ff 100644 --- a/docs/reference/guess_frequency.html +++ b/docs/reference/guess_frequency.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/holiday_aus.html b/docs/reference/holiday_aus.html index 4bf44700..147e0668 100644 --- a/docs/reference/holiday_aus.html +++ b/docs/reference/holiday_aus.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/id.html b/docs/reference/id.html index 6420b0e9..2f27ea49 100644 --- a/docs/reference/id.html +++ b/docs/reference/id.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/index-by.html b/docs/reference/index-by.html index dc4c8ebe..cd9a8bef 100644 --- a/docs/reference/index-by.html +++ b/docs/reference/index-by.html @@ -84,7 +84,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/index-rd.html b/docs/reference/index-rd.html index 5c57143a..40614962 100644 --- a/docs/reference/index-rd.html +++ b/docs/reference/index-rd.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/index.html b/docs/reference/index.html index 67fc70c2..44a52881 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -77,7 +77,7 @@ tsibble - 0.5.2 + 0.5.3 @@ -216,15 +216,15 @@

group_by_key()

+

append_row()

-

Group by key variables

+

Append rows to a tsibble

-

split_by()

+

group_by_key()

-

Split a data frame into a list of subsets by variables

+

Group by key variables

@@ -412,16 +412,10 @@

is_regular() is.regular() is_ordered()

+

is_regular() is_ordered()

is_regular checks if a tsibble is spaced at regular time or not; is_ordered checks if a tsibble is ordered by key and index.

- - - -

case_na()

- -

A thin wrapper of dplyr::case_when() if there are NAs

diff --git a/docs/reference/index_valid.html b/docs/reference/index_valid.html index 463987a1..75ac134d 100644 --- a/docs/reference/index_valid.html +++ b/docs/reference/index_valid.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/is-tsibble.html b/docs/reference/is-tsibble.html index 9a6674d5..4390a3c2 100644 --- a/docs/reference/is-tsibble.html +++ b/docs/reference/is-tsibble.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/key-size.html b/docs/reference/key-size.html index 138c1775..e06f10c1 100644 --- a/docs/reference/key-size.html +++ b/docs/reference/key-size.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/key.html b/docs/reference/key.html index 54739235..7d73198a 100644 --- a/docs/reference/key.html +++ b/docs/reference/key.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/key_sum.html b/docs/reference/key_sum.html index b08f43bb..6a29b376 100644 --- a/docs/reference/key_sum.html +++ b/docs/reference/key_sum.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/key_update.html b/docs/reference/key_update.html index 3c4d8c5b..7f81bbdf 100644 --- a/docs/reference/key_update.html +++ b/docs/reference/key_update.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/measured-vars.html b/docs/reference/measured-vars.html index faba14b9..3455cf97 100644 --- a/docs/reference/measured-vars.html +++ b/docs/reference/measured-vars.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/new_interval.html b/docs/reference/new_interval.html index fc769431..ea5df84d 100644 --- a/docs/reference/new_interval.html +++ b/docs/reference/new_interval.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/pedestrian.html b/docs/reference/pedestrian.html index 1112c484..b9ee42b6 100644 --- a/docs/reference/pedestrian.html +++ b/docs/reference/pedestrian.html @@ -80,7 +80,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/period.html b/docs/reference/period.html index a4f09f69..cb0652e7 100644 --- a/docs/reference/period.html +++ b/docs/reference/period.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3 @@ -196,37 +196,19 @@

Examp #> [7] "2016 Jun" "2016 Aug" "2016 Aug" "2016 Sep" "2016 Oct" "2016 Nov"
#> [1] "2016 Jan" "2016 Feb" "2016 Mar" "2016 Apr" "2016 May" "2016 Jun" #> [7] "2016 Jul" "2016 Aug" "2016 Sep" "2016 Oct" "2016 Nov" "2016 Dec"
yearmonth("201807")
#> [1] "2018 Jul"
yearquarter(x)
#> [1] "2016 Q1" "2016 Q1" "2016 Q1" "2016 Q2" "2016 Q2" "2016 Q2" "2016 Q3" #> [8] "2016 Q3" "2016 Q3" "2016 Q4" "2016 Q4" "2016 Q4"
-# coerce numerics to yearmonth, yearquarter ---- -yearmonth(seq(2010, 2017, by = 1 / 12))
#> [1] "2010 Jan" "2010 Feb" "2010 Mar" "2010 Apr" "2010 May" "2010 Jun" -#> [7] "2010 Jul" "2010 Aug" "2010 Sep" "2010 Oct" "2010 Nov" "2010 Dec" -#> [13] "2011 Jan" "2011 Feb" "2011 Mar" "2011 Apr" "2011 May" "2011 Jun" -#> [19] "2011 Jul" "2011 Aug" "2011 Sep" "2011 Oct" "2011 Nov" "2011 Dec" -#> [25] "2012 Jan" "2012 Feb" "2012 Mar" "2012 Apr" "2012 May" "2012 Jun" -#> [31] "2012 Jul" "2012 Aug" "2012 Sep" "2012 Oct" "2012 Nov" "2012 Dec" -#> [37] "2013 Jan" "2013 Feb" "2013 Mar" "2013 Apr" "2013 May" "2013 Jun" -#> [43] "2013 Jul" "2013 Aug" "2013 Sep" "2013 Oct" "2013 Nov" "2013 Dec" -#> [49] "2014 Jan" "2014 Feb" "2014 Mar" "2014 Apr" "2014 May" "2014 Jun" -#> [55] "2014 Jul" "2014 Aug" "2014 Sep" "2014 Oct" "2014 Nov" "2014 Dec" -#> [61] "2015 Jan" "2015 Feb" "2015 Mar" "2015 Apr" "2015 May" "2015 Jun" -#> [67] "2015 Jul" "2015 Aug" "2015 Sep" "2015 Oct" "2015 Nov" "2015 Dec" -#> [73] "2016 Jan" "2016 Feb" "2016 Mar" "2016 Apr" "2016 May" "2016 Jun" -#> [79] "2016 Jul" "2016 Aug" "2016 Sep" "2016 Oct" "2016 Nov" "2016 Dec" -#> [85] "2017 Jan"
yearquarter(seq(2010, 2017, by = 1 / 4))
#> [1] "2010 Q1" "2010 Q2" "2010 Q3" "2010 Q4" "2011 Q1" "2011 Q2" "2011 Q3" -#> [8] "2011 Q4" "2012 Q1" "2012 Q2" "2012 Q3" "2012 Q4" "2013 Q1" "2013 Q2" -#> [15] "2013 Q3" "2013 Q4" "2014 Q1" "2014 Q2" "2014 Q3" "2014 Q4" "2015 Q1" -#> [22] "2015 Q2" "2015 Q3" "2015 Q4" "2016 Q1" "2016 Q2" "2016 Q3" "2016 Q4" -#> [29] "2017 Q1"
# coerce yearmonths to yearquarter ---- y <- yearmonth(x) yearquarter(y)
#> [1] "2016 Q1" "2016 Q1" "2016 Q1" "2016 Q2" "2016 Q2" "2016 Q2" "2016 Q3" #> [8] "2016 Q3" "2016 Q3" "2016 Q4" "2016 Q4" "2016 Q4"
-# S3 method seq() ---- -wk1 <- yearweek(as.Date("2017-11-01")) -wk2 <- yearweek(as.Date("2018-04-29")) +# seq() and binary operaters ---- +wk1 <- yearweek("2017-11-01") +wk2 <- yearweek("2018-04-29") seq(from = wk1, to = wk2, by = 2) # by two weeks
#> [1] "2017 W44" "2017 W46" "2017 W48" "2017 W50" "2017 W52" "2018 W02" #> [7] "2018 W04" "2018 W06" "2018 W08" "2018 W10" "2018 W12" "2018 W14" -#> [13] "2018 W16"
mth <- yearmonth(as.Date("2017-11-01")) -seq(mth, length.out = 5, by = 1) # by 1 month
#> [1] "2017 Nov" "2017 Dec" "2018 Jan" "2018 Feb" "2018 Mar"
seq(yearquarter(mth), length.out = 5, by = 1) # by 1 quarter
#> [1] "2017 Q4" "2018 Q1" "2018 Q2" "2018 Q3" "2018 Q4"
is_53weeks(2015:2016)
#> [1] TRUE FALSE
+#> [13] "2018 W16"
wk1 + 0:9
#> [1] "2017 W44" "2017 W45" "2017 W46" "2017 W47" "2017 W48" "2017 W49" +#> [7] "2017 W50" "2017 W51" "2017 W52" "2018 W01"
mth <- yearmonth("2017-11-01") +seq(mth, length.out = 5, by = 1) # by 1 month
#> [1] "2017 Nov" "2017 Dec" "2018 Jan" "2018 Feb" "2018 Mar"
mth + 0:9
#> [1] "2017 Nov" "2017 Dec" "2018 Jan" "2018 Feb" "2018 Mar" "2018 Apr" +#> [7] "2018 May" "2018 Jun" "2018 Jul" "2018 Aug"
seq(yearquarter(mth), length.out = 5, by = 1) # by 1 quarter
#> [1] "2017 Q4" "2018 Q1" "2018 Q2" "2018 Q3" "2018 Q4"
is_53weeks(2015:2016)
#> [1] TRUE FALSE
diff --git a/docs/reference/reexports.html b/docs/reference/reexports.html index fa9d14c7..966f1fa0 100644 --- a/docs/reference/reexports.html +++ b/docs/reference/reexports.html @@ -89,7 +89,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/regular.html b/docs/reference/regular.html index d923a1b7..aed837c4 100644 --- a/docs/reference/regular.html +++ b/docs/reference/regular.html @@ -82,7 +82,7 @@ tsibble - 0.5.2 + 0.5.3 @@ -151,8 +151,6 @@

is_regular checks if a tsibble is spaced at regular time or not
is_regular(x)
 
-is.regular(x)
-
 is_ordered(x)

Arguments

diff --git a/docs/reference/slide.html b/docs/reference/slide.html index 60e7a767..99bb55c9 100644 --- a/docs/reference/slide.html +++ b/docs/reference/slide.html @@ -84,7 +84,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/slide2.html b/docs/reference/slide2.html index fa61188f..c0f46827 100644 --- a/docs/reference/slide2.html +++ b/docs/reference/slide2.html @@ -84,7 +84,7 @@ tsibble - 0.5.2 + 0.5.3 @@ -358,30 +358,30 @@

Examp my_df %>% nest(-group) %>% mutate(slope = purrr::map(data, ~ pslide_dbl(., slope, .size = 2))) %>% - unnest()
#> group slope x y date -#> 1 a NA 1 1.5878623 2016-06-01 -#> 2 a 3.34639883 2 4.9342611 2016-06-02 -#> 3 a 2.90605561 3 7.8403167 2016-06-03 -#> 4 a -0.54513640 4 7.2951803 2016-06-04 -#> 5 a 2.71332998 5 10.0085103 2016-06-05 -#> 6 a 4.02567957 6 14.0341899 2016-06-06 -#> 7 a -1.37587595 7 12.6583139 2016-06-07 -#> 8 a 4.50066525 8 17.1589792 2016-06-08 -#> 9 b NA 8 15.7967910 2016-06-01 -#> 10 b 2.17481960 7 13.6219714 2016-06-02 -#> 11 b -0.11413960 6 13.7361110 2016-06-03 -#> 12 b 4.58135886 5 9.1547522 2016-06-04 -#> 13 b 2.11632368 4 7.0384285 2016-06-05 -#> 14 b 0.02093745 3 7.0174911 2016-06-06 -#> 15 b 4.51354479 2 2.5039463 2016-06-07 -#> 16 b 1.68876499 1 0.8151813 2016-06-08
## window over 2 months + unnest()
#> group slope x y date +#> 1 a NA 1 0.6583139 2016-06-01 +#> 2 a 4.5006653 2 5.1589792 2016-06-02 +#> 3 a 0.6378119 3 5.7967910 2016-06-03 +#> 4 a 1.8251804 4 7.6219714 2016-06-04 +#> 5 a 4.1141396 5 11.7361110 2016-06-05 +#> 6 a -0.5813589 6 11.1547522 2016-06-06 +#> 7 a 1.8836763 7 13.0384285 2016-06-07 +#> 8 a 3.9790625 8 17.0174911 2016-06-08 +#> 9 b NA 8 14.5039463 2016-06-01 +#> 10 b 1.6887650 7 12.8151813 2016-06-02 +#> 11 b 0.1849469 6 12.6302344 2016-06-03 +#> 12 b 0.5289819 5 12.1012525 2016-06-04 +#> 13 b 4.7149893 4 7.3862632 2016-06-05 +#> 14 b 3.0209015 3 4.3653617 2016-06-06 +#> 15 b 0.3758028 2 3.9895589 2016-06-07 +#> 16 b 2.6460650 1 1.3434939 2016-06-08
## window over 2 months pedestrian %>% filter(Sensor == "Southern Cross Station") %>% index_by(yrmth = yearmonth(Date_Time)) %>% nest(-yrmth) %>% mutate(ma = slide_dbl(data, ~ mean(.$Count), .size = 2, .bind = TRUE))
#> # A tibble: 24 x 3 #> yrmth data ma -#> * <mth> <list> <dbl> +#> <mth> <list> <dbl> #> 1 2015 Jan <tsibble [744 × 5]> NA #> 2 2015 Feb <tsibble [672 × 5]> 424. #> 3 2015 Mar <tsibble [744 × 5]> 477. @@ -403,7 +403,7 @@

Examp nest(-Sensor) %>% mutate(diag = purrr::map(data, ~ pslide_dfr(., my_diag, .size = 48)))

#> # A tibble: 3 x 3 #> Sensor data diag -#> * <chr> <list> <list> +#> <chr> <list> <list> #> 1 Birrarung Marr <tsibble [744 × 4]> <tibble [33,457 × 2]> #> 2 QV Market-Elizabeth St (West) <tsibble [744 × 4]> <tibble [33,457 × 2]> #> 3 Southern Cross Station <tsibble [744 × 4]> <tibble [33,457 × 2]>
diff --git a/docs/reference/slider.html b/docs/reference/slider.html index f538bd67..837b4061 100644 --- a/docs/reference/slider.html +++ b/docs/reference/slider.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/split-by.html b/docs/reference/split-by.html index 3b43bcde..f72a4c34 100644 --- a/docs/reference/split-by.html +++ b/docs/reference/split-by.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/stretch.html b/docs/reference/stretch.html index 389ad04b..2c6da37f 100644 --- a/docs/reference/stretch.html +++ b/docs/reference/stretch.html @@ -84,7 +84,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/stretch2.html b/docs/reference/stretch2.html index 5c1c8c34..363f1c56 100644 --- a/docs/reference/stretch2.html +++ b/docs/reference/stretch2.html @@ -84,7 +84,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/stretcher.html b/docs/reference/stretcher.html index d80b4b3c..e5555cc2 100644 --- a/docs/reference/stretcher.html +++ b/docs/reference/stretcher.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/tidyverse.html b/docs/reference/tidyverse.html index 9cdf2c04..e5ca66bd 100644 --- a/docs/reference/tidyverse.html +++ b/docs/reference/tidyverse.html @@ -92,7 +92,7 @@ tsibble - 0.5.2 + 0.5.3 @@ -448,43 +448,43 @@

Examp X = rnorm(10, 0, 1), Y = rnorm(10, 0, 2), Z = rnorm(10, 0, 4) -)
#> The `index` is `time`.
stocks %>% gather(stock, price, -time)
#> # A tsibble: 30 x 3 [1D] +)
#> Column `time` is the index.
stocks %>% gather(stock, price, -time)
#> # A tsibble: 30 x 3 [1D] #> # Key: stock [3] -#> time stock price -#> <date> <chr> <dbl> -#> 1 2009-01-01 X 0.630 -#> 2 2009-01-02 X 2.10 -#> 3 2009-01-03 X -0.614 -#> 4 2009-01-04 X -1.63 -#> 5 2009-01-05 X -0.0104 -#> 6 2009-01-06 X -0.657 -#> 7 2009-01-07 X -0.670 -#> 8 2009-01-08 X -0.479 -#> 9 2009-01-09 X 1.32 -#> 10 2009-01-10 X 0.637 +#> time stock price +#> <date> <chr> <dbl> +#> 1 2009-01-01 X -0.670 +#> 2 2009-01-02 X -0.479 +#> 3 2009-01-03 X 1.32 +#> 4 2009-01-04 X 0.637 +#> 5 2009-01-05 X 0.514 +#> 6 2009-01-06 X -1.75 +#> 7 2009-01-07 X 0.894 +#> 8 2009-01-08 X 0.223 +#> 9 2009-01-09 X 0.581 +#> 10 2009-01-10 X -0.178 #> # ... with 20 more rows
# example from tidyr stocks <- tsibble( time = as.Date('2009-01-01') + 0:9, X = rnorm(10, 0, 1), Y = rnorm(10, 0, 2), Z = rnorm(10, 0, 4) -)
#> The `index` is `time`.
stocksm <- stocks %>% gather(stock, price, -time) +)
#> Column `time` is the index.
stocksm <- stocks %>% gather(stock, price, -time) stocksm %>% spread(stock, price)
#> # A tsibble: 10 x 4 [1D] -#> time X Y Z -#> <date> <dbl> <dbl> <dbl> -#> 1 2009-01-01 -1.17 -2.57 0.0143 -#> 2 2009-01-02 -0.480 -2.06 -1.42 -#> 3 2009-01-03 0.115 3.03 4.59 -#> 4 2009-01-04 -1.77 0.694 -0.885 -#> 5 2009-01-05 -1.41 3.56 4.07 -#> 6 2009-01-06 0.709 0.773 -1.05 -#> 7 2009-01-07 -1.24 -1.84 6.63 -#> 8 2009-01-08 -0.368 -3.17 -3.10 -#> 9 2009-01-09 0.462 -0.168 -3.70 -#> 10 2009-01-10 -0.323 -4.17 -1.10
pedestrian %>% +#> time X Y Z +#> <date> <dbl> <dbl> <dbl> +#> 1 2009-01-01 -1.24 -1.84 6.63 +#> 2 2009-01-02 -0.368 -3.17 -3.10 +#> 3 2009-01-03 0.462 -0.168 -3.70 +#> 4 2009-01-04 -0.323 -4.17 -1.10 +#> 5 2009-01-05 -1.29 0.00714 -2.37 +#> 6 2009-01-06 -1.03 -0.712 -0.489 +#> 7 2009-01-07 1.51 2.29 4.72 +#> 8 2009-01-08 0.347 -0.442 2.56 +#> 9 2009-01-09 1.78 2.04 -2.52 +#> 10 2009-01-10 0.387 -0.527 -3.23
pedestrian %>% nest(-Sensor)
#> # A tibble: 4 x 2 #> Sensor data -#> * <chr> <list> +#> <chr> <list> #> 1 Birrarung Marr <tsibble [14,592 × 4]> #> 2 Bourke Street Mall (North) <tsibble [16,414 × 4]> #> 3 QV Market-Elizabeth St (West) <tsibble [17,526 × 4]> @@ -492,7 +492,7 @@

Examp group_by(Sensor) %>% nest()

#> # A tibble: 4 x 2 #> Sensor data -#> * <chr> <list> +#> <chr> <list> #> 1 Birrarung Marr <tsibble [14,592 × 4]> #> 2 Bourke Street Mall (North) <tsibble [16,414 × 4]> #> 3 QV Market-Elizabeth St (West) <tsibble [17,526 × 4]> diff --git a/docs/reference/tile.html b/docs/reference/tile.html index 972d5cdd..cb638f47 100644 --- a/docs/reference/tile.html +++ b/docs/reference/tile.html @@ -84,7 +84,7 @@ tsibble - 0.5.2 + 0.5.3
diff --git a/docs/reference/tile2.html b/docs/reference/tile2.html index 9b46f98c..7ee26e56 100644 --- a/docs/reference/tile2.html +++ b/docs/reference/tile2.html @@ -84,7 +84,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/tiler.html b/docs/reference/tiler.html index 4f443b32..ec87f21b 100644 --- a/docs/reference/tiler.html +++ b/docs/reference/tiler.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/time_unit.html b/docs/reference/time_unit.html index 57fabc71..73a88afd 100644 --- a/docs/reference/time_unit.html +++ b/docs/reference/time_unit.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/tourism.html b/docs/reference/tourism.html index cdf87bea..26925fab 100644 --- a/docs/reference/tourism.html +++ b/docs/reference/tourism.html @@ -80,7 +80,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/reference/tsibble-package.html b/docs/reference/tsibble-package.html index 29b2a7e6..e6590252 100644 --- a/docs/reference/tsibble-package.html +++ b/docs/reference/tsibble-package.html @@ -82,7 +82,7 @@ tsibble - 0.5.2 + 0.5.3 @@ -185,6 +185,8 @@

Key

Region is the lower level than State in Australia; in other words, Region is nested into State, which naturally forms a hierarchy. A vertical bar (|) is used to describe this nesting relationship, and thus Region | State. +Alternatively, a forward slash (/) expresses the equivalent hierarchy but +in a reverse order, for example State / Region. In theory, nesting can involve infinite levels, so is tsibble.

  • Crossed variables: a crossing of one variable with another. For example, the geographical locations are crossed with the purpose of visiting (Purpose) @@ -233,45 +235,42 @@

    See a

    Examples

    # create a tsibble w/o a key ---- -tsbl1 <- tsibble( - date = seq(as.Date("2017-01-01"), as.Date("2017-01-10"), by = 1), - value = rnorm(10), - key = id(), index = date -) -tsbl1
    #> # A tsibble: 10 x 2 [1D] +tsibble( + date = as.Date("2017-01-01") + 0:9, + value = rnorm(10) +)
    #> Column `date` is the index.
    #> # A tsibble: 10 x 2 [1D] #> date value #> <date> <dbl> -#> 1 2017-01-01 -0.593 -#> 2 2017-01-02 -0.122 -#> 3 2017-01-03 1.18 -#> 4 2017-01-04 0.641 -#> 5 2017-01-05 -0.630 -#> 6 2017-01-06 -0.808 -#> 7 2017-01-07 -0.860 -#> 8 2017-01-08 -2.17 -#> 9 2017-01-09 -1.38 -#> 10 2017-01-10 -0.493
    +#> 1 2017-01-01 -0.860 +#> 2 2017-01-02 -2.17 +#> 3 2017-01-03 -1.38 +#> 4 2017-01-04 -0.493 +#> 5 2017-01-05 -0.582 +#> 6 2017-01-06 -0.167 +#> 7 2017-01-07 0.486 +#> 8 2017-01-08 -1.33 +#> 9 2017-01-09 -0.262 +#> 10 2017-01-10 0.652
    # create a tsibble with one key ---- -tsbl2 <- tsibble( - qtr = rep(yearquarter(seq(2010, 2012.25, by = 1 / 4)), 3), +tsibble( + qtr = rep(yearquarter("201001") + 0:9, 3), group = rep(c("x", "y", "z"), each = 10), value = rnorm(30), - key = id(group), index = qtr -) -tsbl2
    #> # A tsibble: 30 x 3 [1Q] + key = id(group) +)
    #> Column `qtr` is the index.
    #> # A tsibble: 30 x 3 [1Q] #> # Key: group [3] -#> qtr group value -#> <qtr> <chr> <dbl> -#> 1 2010 Q1 x -0.582 -#> 2 2010 Q2 x -0.167 -#> 3 2010 Q3 x 0.486 -#> 4 2010 Q4 x -1.33 -#> 5 2011 Q1 x -0.262 -#> 6 2011 Q2 x 0.652 -#> 7 2011 Q3 x 0.749 -#> 8 2011 Q4 x 0.897 -#> 9 2012 Q1 x 1.49 -#> 10 2012 Q2 x -0.659 +#> qtr group value +#> <qtr> <chr> <dbl> +#> 1 2010 Q1 x 0.749 +#> 2 2010 Q2 x 0.897 +#> 3 2010 Q3 x 1.49 +#> 4 2010 Q4 x -0.659 +#> 5 2011 Q1 x 0.537 +#> 6 2011 Q2 x 0.747 +#> 7 2011 Q3 x 1.90 +#> 8 2011 Q4 x -2.06 +#> 9 2012 Q1 x 0.0645 +#> 10 2012 Q2 x -0.265 #> # ... with 20 more rows
    @@ -214,6 +214,8 @@

    Key

    Region is the lower level than State in Australia; in other words, Region is nested into State, which naturally forms a hierarchy. A vertical bar (|) is used to describe this nesting relationship, and thus Region | State. +Alternatively, a forward slash (/) expresses the equivalent hierarchy but +in a reverse order, for example State / Region. In theory, nesting can involve infinite levels, so is tsibble.

  • Crossed variables: a crossing of one variable with another. For example, the geographical locations are crossed with the purpose of visiting (Purpose) @@ -253,45 +255,42 @@

    See a

    Examples

    # create a tsibble w/o a key ---- -tsbl1 <- tsibble( - date = seq(as.Date("2017-01-01"), as.Date("2017-01-10"), by = 1), - value = rnorm(10), - key = id(), index = date -) -tsbl1
    #> # A tsibble: 10 x 2 [1D] -#> date value -#> <date> <dbl> -#> 1 2017-01-01 0.687 -#> 2 2017-01-02 0.705 -#> 3 2017-01-03 0.991 -#> 4 2017-01-04 1.14 -#> 5 2017-01-05 -1.24 -#> 6 2017-01-06 2.65 -#> 7 2017-01-07 -0.157 -#> 8 2017-01-08 -0.423 -#> 9 2017-01-09 -0.198 -#> 10 2017-01-10 -0.895
    +tsibble( + date = as.Date("2017-01-01") + 0:9, + value = rnorm(10) +)
    #> Column `date` is the index.
    #> # A tsibble: 10 x 2 [1D] +#> date value +#> <date> <dbl> +#> 1 2017-01-01 -0.157 +#> 2 2017-01-02 -0.423 +#> 3 2017-01-03 -0.198 +#> 4 2017-01-04 -0.895 +#> 5 2017-01-05 0.904 +#> 6 2017-01-06 0.0796 +#> 7 2017-01-07 -1.26 +#> 8 2017-01-08 1.03 +#> 9 2017-01-09 -0.731 +#> 10 2017-01-10 -0.190
    # create a tsibble with one key ---- -tsbl2 <- tsibble( - qtr = rep(yearquarter(seq(2010, 2012.25, by = 1 / 4)), 3), +tsibble( + qtr = rep(yearquarter("201001") + 0:9, 3), group = rep(c("x", "y", "z"), each = 10), value = rnorm(30), - key = id(group), index = qtr -) -tsbl2
    #> # A tsibble: 30 x 3 [1Q] + key = id(group) +)
    #> Column `qtr` is the index.
    #> # A tsibble: 30 x 3 [1Q] #> # Key: group [3] #> qtr group value #> <qtr> <chr> <dbl> -#> 1 2010 Q1 x 0.904 -#> 2 2010 Q2 x 0.0796 -#> 3 2010 Q3 x -1.26 -#> 4 2010 Q4 x 1.03 -#> 5 2011 Q1 x -0.731 -#> 6 2011 Q2 x -0.190 -#> 7 2011 Q3 x 0.529 -#> 8 2011 Q4 x 0.550 -#> 9 2012 Q1 x 0.550 -#> 10 2012 Q2 x -0.660 +#> 1 2010 Q1 x 0.529 +#> 2 2010 Q2 x 0.550 +#> 3 2010 Q3 x 0.550 +#> 4 2010 Q4 x -0.660 +#> 5 2011 Q1 x 0.0574 +#> 6 2011 Q2 x -2.81 +#> 7 2011 Q3 x -0.912 +#> 8 2011 Q4 x -0.782 +#> 9 2012 Q1 x -0.664 +#> 10 2012 Q2 x 0.626 #> # ... with 20 more rows
    diff --git a/docs/reference/units_since.html b/docs/reference/units_since.html index 8f121c0e..efded507 100644 --- a/docs/reference/units_since.html +++ b/docs/reference/units_since.html @@ -79,7 +79,7 @@ tsibble - 0.5.2 + 0.5.3 diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 9da69201..75d4e081 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -3,6 +3,9 @@ https://pkg.earo.me/tsibble/index.html + + https://pkg.earo.me/tsibble/reference/append-row.html + https://pkg.earo.me/tsibble/reference/as-tibble.html diff --git a/revdep/checks.rds b/revdep/checks.rds index 1bae187608b703f297fa9ff1295c165731f94148..f223e884213b50451002714c7ec647740d253a0d 100644 GIT binary patch literal 846 zcmV-U1F`%ciwFP!000001LampbJH*scC&PYGBD)^10F7zmNFfhwzQn!khTMy zGK#G@nmU$8lDlx?Z@_=0<=K|pRLL;q(gQe=B|W{Tw|t+Je3`c_t728_Q&y##4Hw~6 zgLY+E)oeTi?J=||kj_E>yknmcE+~ubRkV&gyU}#L){48i;x?BI-KQ6=jqb+UvK?T4 zPGfH!Z6MdsdD1zOX+W9X@K6)AR$X(GTI1l8DSJTT?(PXXIX+xz8B2@1sgN8;6gwYD z)MF`+iJ>x|N9?)qh3zXNEA5skK*$M>fdXlG1#kHM3mz87EFQX!kY)f4%Q%tp%Us*lx7*NSBJ5PhBggbzPza z`=>X!K`AEUUcja~0KD=Qh!wqIrNph+P!zbSq`@4cJ_mvs*w1lxjx_NWvVFe8>-zfo zR{?o`B&!PgX@eur-cx&@u~U0Hpg#2NA&apXAQGhS4AsU!%H*x%gn8wV&xTH6!&$v-$N_)20buYb6Sj{J``M%7tSV(|yuSs4Mt+)b&bZJn&oPf_9O`*J zW-^QGR^4g|mIEWEJ?BIKY7W7iIi2J*bQJ#`PR;_7IR1e6r=rXlb#j5@x_OTx78;^aw5`5iUOHinM`Y-hnU6^8sYl3>ZKtVCX7olnR5o!<_lkv4oij7@5JC1i|o3i zF^=39CTU(CKzZ!Xa9`QmS*6f94BH_D9%ZyJiL;y$N8DykW|mnwA`LklGASmLXRcfy zXOB0+o}K>vu%~90ZvT#qDf9S0Df4=Nz^RZd8Q4eo!ru1v6bXFscho6O!4ityV;7UD zQ_t7NX#>|zNt?Z|Kj8U!|Fqe;BW>~={&~twtnSV4#@JP00Br71yNM@rSOTQ~52^V> YSR-*jVxJN*mV$Nl8+n+d*W3yK0D?@O4gdfE literal 731 zcmV<10wnz(iwFP!000001Km|kZ__XsPSbW{9pgje2qHH+v^q|^jSdayG!1SXIwrVP zPU@!C(m1l6wQ%AG@YCQgwK$2LwQdh^;6fySy&rx*p2zK%hGki{RjpSnyP9qHVYWM_YW; z#SAm45jcnt=SH4;iS!>)HW`q3M3?ZWD??kSln@z;>A->$-;c0iWR>fxyy1ZkfZ!BD zsFQ&bRA`#%rnR9dfyajJvkyd!Q{QQ_Rz!Ta$gbBJA>Tj32fDg|q1b8m@?Zx=KPn4# zQ(f1Rpy1}Nrk=mZRkQY5wl}L94MofZl;IhN$6lhZHW%qoS z(_*oh7jWcH#a6Iv8TdWFM2tG0B`usYEVp1Px4m$JNCW~pd25&-j)h40Yu63)?qw!! z=9YQ6JPn!bm*6hpJjEtec1pdWkXU*k!{xG4`%;JFA&vur`C7`> N{5Kd4a}YZS000DIU~d2b