From 6445c563b6a40431af5e3a05898813b18afff38c Mon Sep 17 00:00:00 2001 From: earowang Date: Sun, 5 Aug 2018 15:24:24 -0500 Subject: [PATCH] updated pkgdown site --- docs/CODE_OF_CONDUCT.html | 2 +- docs/CONTRIBUTING.html | 2 +- docs/ISSUE_TEMPLATE.html | 2 +- docs/SUPPORT.html | 2 +- docs/articles/index.html | 2 +- docs/articles/intro-tsibble.html | 22 +-- docs/articles/window.html | 27 ++-- docs/authors.html | 2 +- docs/index.html | 28 ++-- docs/news/index.html | 37 ++--- docs/reference/as-tibble.html | 4 +- docs/reference/as-tsibble.html | 9 +- docs/reference/as.ts.tbl_ts.html | 2 +- docs/reference/build_tsibble.html | 17 +-- docs/reference/case_na.html | 6 +- docs/reference/difference.html | 10 +- docs/reference/fill-na.html | 12 +- docs/reference/find_duplicates.html | 2 +- docs/reference/gaps.html | 6 +- 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 | 31 ++--- docs/reference/index-rd.html | 2 +- docs/reference/index.html | 20 ++- docs/reference/index_valid.html | 2 +- docs/reference/is-tsibble.html | 12 +- docs/reference/key-size.html | 2 +- docs/reference/key.html | 4 +- docs/reference/key_sum.html | 2 +- docs/reference/key_update.html | 2 +- docs/reference/measured-vars.html | 2 +- docs/reference/pedestrian.html | 6 +- docs/reference/period.html | 6 +- docs/reference/pull-interval.html | 22 ++- docs/reference/reexports.html | 4 +- docs/reference/regular.html | 2 +- docs/reference/slide.html | 2 +- docs/reference/slide2.html | 10 +- 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 | 16 +-- docs/reference/tidyverse.html | 68 ++++----- docs/reference/tile.html | 2 +- docs/reference/tile2.html | 2 +- docs/reference/tiler.html | 2 +- docs/reference/time_unit.html | 208 ++++++++++++++++++++++++++++ docs/reference/tourism.html | 6 +- docs/reference/tsibble-package.html | 23 ++- docs/reference/tsibble.html | 14 +- docs/reference/units_since.html | 2 +- docs/sitemap.xml | 3 + 55 files changed, 450 insertions(+), 237 deletions(-) create mode 100644 docs/reference/time_unit.html diff --git a/docs/CODE_OF_CONDUCT.html b/docs/CODE_OF_CONDUCT.html index 20fb73cc..8fbda682 100644 --- a/docs/CODE_OF_CONDUCT.html +++ b/docs/CODE_OF_CONDUCT.html @@ -77,7 +77,7 @@ tsibble - 0.4.0.9000 + 0.5.0 diff --git a/docs/CONTRIBUTING.html b/docs/CONTRIBUTING.html index dbf760f1..01c19fe8 100644 --- a/docs/CONTRIBUTING.html +++ b/docs/CONTRIBUTING.html @@ -77,7 +77,7 @@ tsibble - 0.4.0.9000 + 0.5.0 diff --git a/docs/ISSUE_TEMPLATE.html b/docs/ISSUE_TEMPLATE.html index 2cb54766..560156f8 100644 --- a/docs/ISSUE_TEMPLATE.html +++ b/docs/ISSUE_TEMPLATE.html @@ -77,7 +77,7 @@ tsibble - 0.4.0.9000 + 0.5.0 diff --git a/docs/SUPPORT.html b/docs/SUPPORT.html index ad3d865b..1e76bf84 100644 --- a/docs/SUPPORT.html +++ b/docs/SUPPORT.html @@ -77,7 +77,7 @@ tsibble - 0.4.0.9000 + 0.5.0 diff --git a/docs/articles/index.html b/docs/articles/index.html index 93b01b99..9816f107 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -77,7 +77,7 @@ tsibble - 0.4.0.9000 + 0.5.0 diff --git a/docs/articles/intro-tsibble.html b/docs/articles/intro-tsibble.html index 427c0b0d..50663e7f 100644 --- a/docs/articles/intro-tsibble.html +++ b/docs/articles/intro-tsibble.html @@ -38,7 +38,7 @@ tsibble - 0.4.0.9000 + 0.5.0 @@ -110,7 +110,7 @@

library(tsibble)
 library(lubridate)
 weather <- nycflights13::weather %>% 
-  select(origin, time_hour, temp, humid, precip)
+  select(origin, time_hour, temp, humid, precip)
 weather
#> # A tibble: 26,115 x 5
 #>   origin time_hour            temp humid precip
@@ -135,11 +135,11 @@ 

#> 4 EWR 2013-01-01 04:00:00 39.9 62.2 0 #> 5 EWR 2013-01-01 05:00:00 39.0 64.4 0 #> # ... with 2.611e+04 more rows

-

The tsibble fully utilises the print method from tibble: a tsibble object (along with its dimension and time interval) and key variables in the header. Above displays the weather_tsbl its one-hour interval and the origin as the key. Given the nature of temporal ordering, a tsibble must be sorted by time index. If a key is explicitly declared, the key will be sorted first and followed by arranging time from past to future. This tidy data representation most naturally supports thinking of operations on the data as building blocks, forming part of a “data pipeline” in time-based context. Users who are familiar with tidyverse would find it easier to perform common time series analysis tasks. For example, index_by() is the counterpart of group_by() in temporal context, but it only groups the time index. index_by() + summarise() is used to summarise daily highs and lows at each station. As a result, the index is updated to the date with one-day interval from time_hour; two new variables are created and computed for daily maximum and minimum temperatures.

+

The tsibble fully utilises the print method from tibble: a tsibble object (along with its dimension and time interval) and key variables in the header. Above displays the weather_tsbl its one-hour interval and the origin as the key. Given the nature of temporal ordering, a tsibble must be sorted by time index. If a key is explicitly declared, the key will be sorted first and followed by arranging time from past to future. This tidy data representation most naturally supports thinking of operations on the data as building blocks, forming part of a “data pipeline” in time-based context. Users who are familiar with tidyverse would find it easier to perform common time series analysis tasks. For example, index_by() is the counterpart of group_by() in temporal context, but it only groups the time index. index_by() + summarise() is used to summarise daily highs and lows at each station. As a result, the index is updated to the date with one-day interval from time_hour; two new variables are created and computed for daily maximum and minimum temperatures.

@@ -169,10 +169,10 @@

#> 4 1998 Q4 Adelaide South Australia Business 127. #> 5 1999 Q1 Adelaide South Australia Business 137. #> # ... with 2.34e+04 more rows -

The commonly used dplyr verbs, such as filter(), summarise() and mutate(), have been implemented to support the tsibble. To obtain the numerical summaries for the geographical variables, summarise() is performed in conjunction with the Region, State in the group_by(). The Purpose variable has been dropped from the key, but Region | State keeps the hierarchical structure. The tsibble summarise() never collapses the rows over the time index, which is slightly different from the dplyr summarise().

+

The commonly used dplyr verbs, such as filter(), summarise() and mutate(), have been implemented to support the tsibble. To obtain the numerical summaries for the geographical variables, summarise() is performed in conjunction with the Region, State in the group_by(). The Purpose variable has been dropped from the key, but Region | State keeps the hierarchical structure. The tsibble summarise() never collapses the rows over the time index, which is slightly different from the dplyr summarise().

tourism %>%
-  group_by(Region, State) %>%
-  summarise(Geo_Trips = sum(Trips))
+ group_by(Region, State) %>% + summarise(Geo_Trips = sum(Trips))
#> # A tsibble: 5,852 x 4 [1Q]
 #> # Key:       Region | State [77]
 #> # Groups:    Region [77]
@@ -191,8 +191,8 @@ 

Intervals

It has been seen that the tsibble handles regularly-spaced temporal data well, from seconds to years based on its time representation (see ?tsibble). The option regular, by default, is set to TRUE in as_tsibble(). Specify regular to FALSE to create a tsibble for the data collected at irregular time interval. Below shows the scheduled date time of the flights in New York City:

The key variable is the flight_num. With regular = FALSE, it turns to an irregularly-spaced tsibble, where [!] highlights the irregularity.

diff --git a/docs/articles/window.html b/docs/articles/window.html index 23e17f94..25e8f968 100644 --- a/docs/articles/window.html +++ b/docs/articles/window.html @@ -38,7 +38,7 @@ tsibble - 0.4.0.9000 + 0.5.0 @@ -94,7 +94,6 @@

A family of window functions

Earo Wang

-

2018-08-04

@@ -133,10 +132,10 @@

2018-08-04

Fixed window size

-

Moving average is one of the common techniques to smooth time series. We can apply daily window smoother (a fixed window size of 24) easily for each sensor. slide() returns an output the same length as the input with .fill = NA (by default) and .align = "center-left" padded at both sides of the data range, so that the result fits into mutate() in harmony. slide_dbl() produces the numeric vector returned by mean().

+

Moving average is one of the common techniques to smooth time series. We can apply daily window smoother (a fixed window size of 24) easily for each sensor. slide() returns an output the same length as the input with .fill = NA (by default) and .align = "center-left" padded at both sides of the data range, so that the result fits into mutate() in harmony. slide_dbl() produces the numeric vector returned by mean().

pedestrian_full %>% 
-  group_by(Sensor) %>% 
-  mutate(Daily_MA = slide_dbl(Count, 
+  group_by(Sensor) %>% 
+  mutate(Daily_MA = slide_dbl(Count, 
     mean, na.rm = TRUE, .size = 24, .align = "center-left"
   ))
 #> # A tsibble: 70,176 x 6 [1h]
@@ -157,7 +156,7 @@ 

Flexible calendar period

What if the time period we’d like to slide over happens not to be a fixed window size, for example sliding over three months. The preprocessing step is to wrap observations into monthly subsets (a list of tsibbles) using nest().

pedestrian_mth <- pedestrian_full %>% 
-  mutate(YrMth = yearmonth(Date_Time)) %>% 
+  mutate(YrMth = yearmonth(Date_Time)) %>% 
   nest(-Sensor, -YrMth)
 pedestrian_mth
 #> # A tibble: 96 x 3
@@ -171,13 +170,13 @@ 

#> # ... with 91 more rows

Now it’s ready to (rock and) roll. When setting .size = 1 in slide(), it behaves exactly the same as purrr::map(), mapping over each element in the object. However, (1) a bundle of 3 subsets (.size = 3) needs to be binded first and then computed for average counts; (2) alternatively, .bind = TRUE takes care of binding data frames by row. The nicely-glued simple operations facilitate complex tasks in an easier-to-comprehend manner.

@@ -201,9 +200,9 @@

list(fitted = fitted(fit), resid = residuals(fit)) } pedestrian_full %>% - filter(Date <= as.Date("2015-03-31")) %>% + filter(Date <= as.Date("2015-03-31")) %>% nest(-Sensor) %>% - mutate(diag = purrr::map(data, ~ pslide_dfr(., my_diag, .size = 24 * 7))) + mutate(diag = purrr::map(data, ~ pslide_dfr(., my_diag, .size = 24 * 7))) #> # A tibble: 4 x 3 #> Sensor data diag #> * <chr> <list> <list> diff --git a/docs/authors.html b/docs/authors.html index 198a9717..1d33c6b8 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -77,7 +77,7 @@ tsibble - 0.4.0.9000 + 0.5.0

diff --git a/docs/index.html b/docs/index.html index 48b79358..769df744 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,7 @@ tsibble - 0.4.0.9000 + 0.5.0
@@ -125,7 +125,7 @@

The weather data included in the package nycflights13 is used as an example to illustrate. The “index” variable is the time_hour containing the date-times, and the “key” is the origin as weather stations created via id(). The key(s) together with the index uniquely identifies each observation, which gives a valid tsibble. Other columns can be considered as measured variables.

library(tsibble)
 weather <- nycflights13::weather %>% 
-  select(origin, time_hour, temp, humid, precip)
+  select(origin, time_hour, temp, humid, precip)
 weather_tsbl <- as_tsibble(weather, key = id(origin), index = time_hour)
 weather_tsbl
 #> # A tsibble: 26,115 x 5 [1h]
@@ -139,7 +139,7 @@ 

#> 5 EWR 2013-01-01 05:00:00 39.0 64.4 0 #> # ... with 2.611e+04 more rows

The key is not constrained to a single variable, but expressive of nested and crossed data structures. This incorporates univariate, multivariate, hierarchical and grouped time series into the tsibble framework. See package?tsibble and vignette("intro-tsibble") for details.

-

The tsibble internally computes the interval for a given time index, based on its representation. The POSIXct corresponds to sub-daily series, Date to daily, yearweek to weekly, yearmonth/yearmth to monthly, yearquarter/yearqtr to quarterly, and etc.

+

The tsibble internally computes the interval for a given time index, based on its time representation. The POSIXct corresponds to sub-daily series, Date to daily, yearweek to weekly, yearmonth/yearmth to monthly, yearquarter/yearqtr to quarterly, and etc.

@@ -147,7 +147,7 @@

Often there are implicit missing cases in temporal data. If the observations are made at regular time interval, we could turn these implicit missings to be explicit simply using fill_na(). Meanwhile, fill NAs in by 0 for precipitation (precip). It is quite common to replaces NAs with its previous observation for each origin in time series analysis, which is easily done using fill() from tidyr.

full_weather <- weather_tsbl %>%
   fill_na(precip = 0) %>% 
-  group_by(origin) %>% 
+  group_by(origin) %>% 
   tidyr::fill(temp, humid, .direction = "down")
 full_weather
 #> # A tsibble: 26,190 x 5 [1h]
@@ -165,12 +165,12 @@ 

-index_by() + summarise() to aggregate over calendar periods

-

index_by() is the counterpart of group_by() in temporal context, but it groups the index only. In conjunction with index_by(), summarise() and its scoped variants aggregate interested variables over calendar periods. index_by() goes hand in hand with the index functions including as.Date(), yearweek(), yearmonth(), and yearquarter(), as well as other friends from lubridate. For example, it would be of interest in computing average temperature and total precipitation per month, by applying yearmonth() to the hourly time index.

+index_by() + summarise() to aggregate over calendar periods

+

index_by() is the counterpart of group_by() in temporal context, but it groups the index only. In conjunction with index_by(), summarise() and its scoped variants aggregate interested variables over calendar periods. index_by() goes hand in hand with the index functions including as.Date(), yearweek(), yearmonth(), and yearquarter(), as well as other friends from lubridate. For example, it would be of interest in computing average temperature and total precipitation per month, by applying yearmonth() to the hourly time index.

-

While collapsing rows (like summarise()), group_by() and index_by() will take care of updating the key and index respectively. This index_by() + summarise() combo can help with regularising a tsibble of irregular time space too.

+

While collapsing rows (like summarise()), group_by() and index_by() will take care of updating the key and index respectively. This index_by() + summarise() combo can help with regularising a tsibble of irregular time space too.

@@ -201,8 +201,8 @@

For example, a moving average of window size 3 is carried out on hourly temperatures for each group (origin).

full_weather %>% 
-  group_by(origin) %>% 
-  mutate(temp_ma = slide_dbl(temp, ~ mean(., na.rm = TRUE), .size = 3))
+  group_by(origin) %>% 
+  mutate(temp_ma = slide_dbl(temp, ~ mean(., na.rm = TRUE), .size = 3))
 #> # A tsibble: 26,190 x 6 [1h]
 #> # Key:       origin [3]
 #> # Groups:    origin [3]
@@ -225,14 +225,14 @@ 

dplyr: diff --git a/docs/news/index.html b/docs/news/index.html index 2604e812..cec6a2ea 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -77,7 +77,7 @@ tsibble - 0.4.0.9000 + 0.5.0

@@ -135,9 +135,9 @@

Changelog

-
+

-tsibble 0.4.0.9000 Unreleased +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.

@@ -158,6 +158,8 @@

Improvements

  • Speed improvement for internals when it’s a known valid tsibble. (#43)
  • +
  • Better support “millisecond” and “microsecond”.
  • +
  • A new vignette on window functions.
@@ -166,7 +168,8 @@

  • Replaced NA or NULL with 0 in the “interval” class to make the representation simpler.
  • The interval class has new slots of “millisecond”, “microsecond”, “nanosecond”.
  • -
  • Retired time_unit() S3 generic, and made index extension a bit easier.
  • +
  • +time_unit() is a function instead of S3 generic, and made index extension a bit easier.

@@ -272,7 +275,7 @@

New functions

    -
  • New difference() computes lagged differences of a numeric vector. It returns a vector of the same length as the input with NA padded. It works with mutate().
  • +
  • New difference() computes lagged differences of a numeric vector. It returns a vector of the same length as the input with NA padded. It works with mutate().
  • Added the support of gather()/spread(), nest()/unnest() to tbl_ts.
@@ -302,7 +305,7 @@

  • index: a variable represents time. This together the “key” uniquely identifies each observation in the data table.
  • -index2: why do we need the second index? It means re-indexing to a variable, not the second index. It is identical to the index most time, but start deviating when using index_by(). index_by() works similarly to group_by(), but groups the index only. The dplyr verbs, like filter(), mutate(), operates on each time group of the data defined by index_by(). You may wonder why introducing a new function rather than using group_by() that users are most familiar with. It’s because time is indispensable to a tsibble, index_by() provides a trace to understanding how the index changes. For this purpose, group_by() is just too general. For example, index_by() + summarise() aggregates data to less granular time period, leading to the update in index, which is nicely and intuitively handled now.
  • +index2: why do we need the second index? It means re-indexing to a variable, not the second index. It is identical to the index most time, but start deviating when using index_by(). index_by() works similarly to group_by(), but groups the index only. The dplyr verbs, like filter(), mutate(), operates on each time group of the data defined by index_by(). You may wonder why introducing a new function rather than using group_by() that users are most familiar with. It’s because time is indispensable to a tsibble, index_by() provides a trace to understanding how the index changes. For this purpose, group_by() is just too general. For example, index_by() + summarise() aggregates data to less granular time period, leading to the update in index, which is nicely and intuitively handled now.
  • interval: an interval class to save a list of time intervals. It computes the greatest common factor from the time difference of the index column, which should give a sensible interval for the almost all the cases, compared to minimal time distance. It also depends on the time representation. For example, if the data is monthly, the index is suggested to use a yearmonth() format instead of Date, as Date only gives the number of days not the number of months.
  • @@ -314,13 +317,13 @@

    Breaking changes

      -
    • Deprecated tsummarise() and its scoped variants. It can be replaced by the combo index_by() + summarise() (#20). tsummarise() provides an unintuitive interface where the first argument keeps the same size of the index, but the remaining arguments reduces rows to a single one. Analogously, it does group_by() and then summarise(). The proposed index_by() solves the issue of index update.
    • +
    • Deprecated tsummarise() and its scoped variants. It can be replaced by the combo index_by() + summarise() (#20). tsummarise() provides an unintuitive interface where the first argument keeps the same size of the index, but the remaining arguments reduces rows to a single one. Analogously, it does group_by() and then summarise(). The proposed index_by() solves the issue of index update.
    • Renamed inform_duplicates() (defunct) to find_duplicates() to better reflect its functionality.
    • -key_vars() and group_vars() return a vector of characters instead of a list.
    • +key_vars() and group_vars() return a vector of characters instead of a list.
    • distinct.tbl_ts() now returns a tibble instead of an error.
    • -
    • No longer reexported dplyr::do() and tidyr::fill(), as they respect the input structure.
    • +
    • No longer reexported dplyr::do() and tidyr::fill(), as they respect the input structure.
    • Defunct index_sum(), and replaced by index_valid() to extend index type support.
  • @@ -329,7 +332,7 @@

    New functions

    • -index_by() groups time index, as the counterpart of group_by() in temporal context.
    • +index_by() groups time index, as the counterpart of group_by() in temporal context.
    • A new S3 generic count_gaps() and gaps() counts time gaps (implicit missing observations in time).
    • yearweek() creates and coerces to a year-week object. (#17)
    • @@ -344,7 +347,7 @@

    • Renamed the drop argument to .drop in column-wise dplyr verbs.
    • Dropped the duplicated argument in pull_interval().
    • -group_by.tbl_ts() behaves exactly the same as group_by.tbl_df now. Grouping variables are temporary for data manipulation. Nested or crossed variables are not the type that group_by() thinks.
    • +group_by.tbl_ts() behaves exactly the same as group_by.tbl_df now. Grouping variables are temporary for data manipulation. Nested or crossed variables are not the type that group_by() thinks.

    @@ -382,7 +385,7 @@

    This release introduces major changes into the underlying tbl_ts object:

    • Dropped the attribute “key_indices” from a tbl_ts class to reduce the object size, and computed on the fly when printing.
    • -
    • Gained a new attribute “ordered” to identify if it is arranged by key and index in ascending order. If not, broadcast a warning. The warning likely occurs to arrange() and slice() functions.
    • +
    • Gained a new attribute “ordered” to identify if it is arranged by key and index in ascending order. If not, broadcast a warning. The warning likely occurs to arrange() and slice() functions.
    • The “index” attribute in a tbl_ts object is a symbol now instead of a quosure.
    • The “key” attribute in a tbl_ts object is an unnamed list of symbols.
    @@ -421,7 +424,7 @@

    Internal changes

    • No longer throw an error when grouping the index.
    • -
    • An interval of regularly spaced tsibble is (re)computed when creating the tsibble and performing the row-wise operations (like filter() and slice()). This avoids unnecessary re-computation for many function calls.
    • +
    • An interval of regularly spaced tsibble is (re)computed when creating the tsibble and performing the row-wise operations (like filter() and slice()). This avoids unnecessary re-computation for many function calls.
    @@ -469,7 +472,7 @@

  • tidyr::fill() fills NA backward or forward in tsibble.
  • Implement tbl_ts support for dplyr::*_join().
  • -
  • No tbl_ts support for dplyr::transmute() and dplyr::distinct() and return an error.
  • +
  • No tbl_ts support for dplyr::transmute() and dplyr::distinct() and return an error.
  • @@ -484,8 +487,8 @@

    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.
    • +
    • 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.
    • Fix incorrect group and key indices.
    • NULL and tbl_ts are supported in as_tsibble(). An empty tsibble is not allowed.
    • @@ -525,7 +528,7 @@

      Contents

      @@ -180,7 +180,7 @@

      Examp #> 10 Birrarung Marr 2015-01-01 09:00:00 2015-01-01 9 166 #> # ... with 66,061 more rows

    # a grouped tbl_ts ----- -grped_ped <- pedestrian %>% group_by(Sensor) +grped_ped <- pedestrian %>% group_by(Sensor) as_tibble(grped_ped)
    #> # A tibble: 66,071 x 5 #> # Groups: Sensor [4] #> Sensor Date_Time Date Time Count diff --git a/docs/reference/as-tsibble.html b/docs/reference/as-tsibble.html index dd2e0539..f1a6ca05 100644 --- a/docs/reference/as-tsibble.html +++ b/docs/reference/as-tsibble.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0
    @@ -196,8 +196,9 @@

    Arg regular -

    Regular time interval (TRUE) or irregular (FALSE). TRUE -finds the greatest common divisor of positive time distances as the interval.

    +

    Regular time interval (TRUE) or irregular (FALSE). The +interval is determined by the greatest common divisor of positive time distances, +if TRUE.

    validate @@ -224,7 +225,7 @@

    Value

    See also

    -

    tsibble

    +

    Examples

    diff --git a/docs/reference/as.ts.tbl_ts.html b/docs/reference/as.ts.tbl_ts.html index 5b92a05e..95d1fe9f 100644 --- a/docs/reference/as.ts.tbl_ts.html +++ b/docs/reference/as.ts.tbl_ts.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0 diff --git a/docs/reference/build_tsibble.html b/docs/reference/build_tsibble.html index 8a47fdfa..ce79b233 100644 --- a/docs/reference/build_tsibble.html +++ b/docs/reference/build_tsibble.html @@ -6,7 +6,7 @@ -Construct a tsibble object — build_tsibble • tsibble +Construct a tsibble object for extension — build_tsibble • tsibble @@ -36,10 +36,10 @@ - + tsibble - 0.4.0.9000 + 0.5.0 @@ -139,7 +139,7 @@
    @@ -147,7 +147,7 @@

    Construct a tsibble object

      -
    • build_tsibble() creates a tbl_ts object with more control. It is useful +

    • 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 users to determine if the time needs ordering and the interval needs calculating.

    • build_tsibble_meta() assigns the attributes to an object, assuming this @@ -190,8 +190,9 @@

      Arg regular -

      Regular time interval (TRUE) or irregular (FALSE). TRUE -finds the greatest common divisor of positive time distances as the interval.

      +

      Regular time interval (TRUE) or irregular (FALSE). The +interval is determined by the greatest common divisor of positive time distances, +if TRUE.

      validate diff --git a/docs/reference/case_na.html b/docs/reference/case_na.html index dc81d1d7..74f944af 100644 --- a/docs/reference/case_na.html +++ b/docs/reference/case_na.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0

    @@ -140,7 +140,7 @@

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

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

    +

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

    @@ -158,7 +158,7 @@

    Arg

    See also

    - +

    Examples

    diff --git a/docs/reference/difference.html b/docs/reference/difference.html index 45d08be7..290db48d 100644 --- a/docs/reference/difference.html +++ b/docs/reference/difference.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0
    @@ -178,7 +178,7 @@

    Value

    See also

    - +

    Examples

    @@ -186,8 +186,8 @@

    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: 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] #> year value diff #> * <int> <dbl> <dbl> #> 1 2000 0 -4 @@ -196,7 +196,7 @@

    Examp #> 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] +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] #> 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 6cb30568..12a567d1 100644 --- a/docs/reference/fill-na.html +++ b/docs/reference/fill-na.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0
    @@ -212,7 +212,7 @@

    Examp #> 8 2013 kiwi 8
    # use fill() to fill `NA` by previous/next entry full_harvest %>% - group_by(fruit) %>% + group_by(fruit) %>% tidyr::fill(kilo, .direction = "down")
    #> # A tsibble: 8 x 3 [1Y] #> # Key: fruit [2] #> # Groups: fruit [2] @@ -257,7 +257,7 @@

    Examp #> 8 2013 kiwi 8

    # replace NA using a function for each group ---- harvest %>% - group_by(fruit) %>% + group_by(fruit) %>% fill_na(kilo = sum(kilo, na.rm = TRUE))
    #> # A tsibble: 8 x 3 [1Y] #> # Key: fruit [2] #> # Groups: fruit [2] @@ -273,10 +273,10 @@

    Examp #> 8 2013 kiwi 8

    # replace NA ---- pedestrian %>% - group_by(Sensor) %>% + group_by(Sensor) %>% fill_na( - Date = lubridate::as_date(Date_Time), - Time = lubridate::hour(Date_Time), + Date = lubridate::as_date(Date_Time), + Time = lubridate::hour(Date_Time), Count = as.integer(median(Count, na.rm = TRUE)) )
    #> # A tsibble: 69,048 x 5 [1h] #> # Key: Sensor [4] diff --git a/docs/reference/find_duplicates.html b/docs/reference/find_duplicates.html index 7a4a3827..42264e4e 100644 --- a/docs/reference/find_duplicates.html +++ b/docs/reference/find_duplicates.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0
    diff --git a/docs/reference/gaps.html b/docs/reference/gaps.html index cc881d01..30af6fac 100644 --- a/docs/reference/gaps.html +++ b/docs/reference/gaps.html @@ -80,7 +80,7 @@ tsibble - 0.4.0.9000 + 0.5.0 @@ -204,7 +204,7 @@

    Examp #> 2 2016-04-03 02:00:00 2016-04-03 02:00:00 1
    # Time gaps for each sensor per month ---- pedestrian %>% index_by(yrmth = yearmonth(Date)) %>% - group_by(Sensor) %>% + group_by(Sensor) %>% count_gaps()
    #> # A tibble: 97 x 5 #> Sensor yrmth from to n #> <chr> <mth> <dttm> <dttm> <int> @@ -220,7 +220,7 @@

    Examp #> 10 Birrarung Marr 2015 Oct NA NA 0 #> # ... with 87 more rows

    # Time gaps for each sensor ---- ped_gaps <- pedestrian %>% - group_by(Sensor) %>% + group_by(Sensor) %>% count_gaps(.full = TRUE) if (!requireNamespace("ggplot2", quietly = TRUE)) { stop("Please install the ggplot2 package to run these following examples.") diff --git a/docs/reference/group_by_key.html b/docs/reference/group_by_key.html index e68e4e7d..e5d5520b 100644 --- a/docs/reference/group_by_key.html +++ b/docs/reference/group_by_key.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0
    diff --git a/docs/reference/guess_frequency.html b/docs/reference/guess_frequency.html index 34ce5f69..36b00416 100644 --- a/docs/reference/guess_frequency.html +++ b/docs/reference/guess_frequency.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0 diff --git a/docs/reference/holiday_aus.html b/docs/reference/holiday_aus.html index 3925b0f3..c30efe40 100644 --- a/docs/reference/holiday_aus.html +++ b/docs/reference/holiday_aus.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0 diff --git a/docs/reference/id.html b/docs/reference/id.html index 74049f2b..ef4bc250 100644 --- a/docs/reference/id.html +++ b/docs/reference/id.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0 diff --git a/docs/reference/index-by.html b/docs/reference/index-by.html index 17e732da..48ab6d2b 100644 --- a/docs/reference/index-by.html +++ b/docs/reference/index-by.html @@ -84,7 +84,7 @@ tsibble - 0.4.0.9000 + 0.5.0 @@ -145,11 +145,11 @@

    Group by time index

    -

    index_by() is the counterpart of group_by() in temporal context, but it +

    index_by() is the counterpart of group_by() in temporal context, but it only groups the time index. It adds a new column and then group it. The following operation is applied to each group of the index, similar to -group_by() but dealing with index only. index_by() + summarise() will -update the grouping index variable to be the new index. Use ungroup() or +group_by() but dealing with index only. index_by() + summarise() will +update the grouping index variable to be the new index. Use ungroup() or index_by() with no arguments to remove the index grouping vars.

    @@ -170,12 +170,12 @@

    Arg index on RHS

  • An existing variable to be used as index The index functions that can be used, but not limited:

  • -
  • lubridate::year: yearly aggregation

  • +
  • lubridate::year: yearly aggregation

  • yearquarter: quarterly aggregation

  • yearmonth: monthly aggregation

  • yearweek: weekly aggregation

  • -
  • as.Date or lubridate::as_date: daily aggregation

  • -
  • lubridate::ceiling_date, lubridate::floor_date, or lubridate::round_date: +

  • as.Date or lubridate::as_date: daily aggregation

  • +
  • lubridate::ceiling_date, lubridate::floor_date, or lubridate::round_date: sub-daily aggregation

  • other index functions from other packages

  • @@ -187,18 +187,15 @@

    Details
    • A index_by()-ed tsibble is indicated by @ in the "Groups" when displaying on the screen.

    • -
    • Time index will not be collapsed by summarise.tbl_ts.

    • -
    • The scoped variants of summarise() only operate on the non-key and -non-index variables.

    Examples

    # Monthly counts across sensors ---- monthly_ped <- pedestrian %>% - group_by(Sensor) %>% + group_by(Sensor) %>% index_by(Year_Month = yearmonth(Date_Time)) %>% - summarise( + summarise( Max_Count = max(Count), Min_Count = min(Count) ) @@ -219,9 +216,9 @@

    Examp #> # ... with 85 more rows

    index(monthly_ped)
    #> Year_Month
    # Using existing variable ---- pedestrian %>% - group_by(Sensor) %>% + group_by(Sensor) %>% index_by(Date) %>% - summarise( + summarise( Max_Count = max(Count), Min_Count = min(Count) )
    #> # A tsibble: 2,755 x 4 [1D] @@ -241,9 +238,9 @@

    Examp #> # ... with 2,745 more rows

    # Annual trips by Region and State ---- tourism %>% - index_by(Year = lubridate::year(Quarter)) %>% - group_by(Region, State) %>% - summarise(Total = sum(Trips))
    #> # A tsibble: 1,463 x 4 [1Y] + index_by(Year = lubridate::year(Quarter)) %>% + group_by(Region, State) %>% + summarise(Total = sum(Trips))
    #> # A tsibble: 1,463 x 4 [1Y] #> # Key: Region | State [77] #> # Groups: Region [77] #> Region State Year Total diff --git a/docs/reference/index-rd.html b/docs/reference/index-rd.html index 34ad84dc..3b5ecb9f 100644 --- a/docs/reference/index-rd.html +++ b/docs/reference/index-rd.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0
    diff --git a/docs/reference/index.html b/docs/reference/index.html index c3a8dd21..08485b9e 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -77,7 +77,7 @@ tsibble - 0.4.0.9000 + 0.5.0 @@ -180,13 +180,13 @@

    is_tsibble() is_grouped_ts()

    -

    Test if the object is a tsibble

    +

    If the object is a tsibble

    build_tsibble() build_tsibble_meta()

    -

    Construct a tsibble object

    +

    Construct a tsibble object for extension

    @@ -306,12 +306,12 @@

    stretcher() pstretcher()

    -

    Splits the input to a list according to the stretching window size.

    +

    Split the input to a list according to the stretching window size.

    -

    Index

    +

    Time

    @@ -333,6 +333,12 @@

    guess_frequency()

    Guess a time frequency from other index objects

    + + + +

    time_unit()

    + +

    Extract time unit from a vector

    @@ -435,7 +441,7 @@

    pull_interval() time_unit()

    +

    pull_interval()

    Extract time interval from a vector

    @@ -505,7 +511,7 @@

    Contents

  • Tsibble verbs
  • Vector
  • Windowed functions
  • -
  • Index
  • +
  • Time
  • Calendar
  • Key helpers
  • Tsibble helpers
  • diff --git a/docs/reference/index_valid.html b/docs/reference/index_valid.html index 1d129ea0..aaa303d8 100644 --- a/docs/reference/index_valid.html +++ b/docs/reference/index_valid.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0 diff --git a/docs/reference/is-tsibble.html b/docs/reference/is-tsibble.html index 01b58f53..a84d7376 100644 --- a/docs/reference/is-tsibble.html +++ b/docs/reference/is-tsibble.html @@ -6,7 +6,7 @@ -Test if the object is a tsibble — is_tsibble • tsibble +If the object is a tsibble — is_tsibble • tsibble @@ -36,9 +36,9 @@ - + - + @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0 @@ -133,14 +133,14 @@
    -

    Test if the object is a tsibble

    +

    If the object is a tsibble

    diff --git a/docs/reference/key-size.html b/docs/reference/key-size.html index a08674d1..4171132a 100644 --- a/docs/reference/key-size.html +++ b/docs/reference/key-size.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0
    diff --git a/docs/reference/key.html b/docs/reference/key.html index 806e2409..9129bef4 100644 --- a/docs/reference/key.html +++ b/docs/reference/key.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0
    @@ -166,7 +166,7 @@

    Examp # Nested and crossed keys for tourism data ---- key(tourism)
    #> Region | State, Purpose
    key_vars(tourism)
    #> [1] "Region" "State" "Purpose"
    # unkey() only works for a tsibble with 1 key size ---- sx <- pedestrian %>% - filter(Sensor == "Southern Cross Station") + filter(Sensor == "Southern Cross Station") unkey(sx)
    #> # A tsibble: 17,539 x 5 [1h] #> Sensor Date_Time Date Time Count #> * <chr> <dttm> <date> <int> <int> diff --git a/docs/reference/key_sum.html b/docs/reference/key_sum.html index e127ef92..5c39435e 100644 --- a/docs/reference/key_sum.html +++ b/docs/reference/key_sum.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0
    diff --git a/docs/reference/key_update.html b/docs/reference/key_update.html index f7968d06..8f2f2b34 100644 --- a/docs/reference/key_update.html +++ b/docs/reference/key_update.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0 diff --git a/docs/reference/measured-vars.html b/docs/reference/measured-vars.html index 2869a1f5..a2d90bcc 100644 --- a/docs/reference/measured-vars.html +++ b/docs/reference/measured-vars.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0 diff --git a/docs/reference/pedestrian.html b/docs/reference/pedestrian.html index 04409a88..c7ef36c7 100644 --- a/docs/reference/pedestrian.html +++ b/docs/reference/pedestrian.html @@ -80,7 +80,7 @@ tsibble - 0.4.0.9000 + 0.5.0 @@ -182,9 +182,9 @@

    Examp #> 10 Birrarung Marr 2015-01-01 09:00:00 2015-01-01 9 166 #> # ... with 69,038 more rows
    # compute daily maximum counts across sensors ---- pedestrian %>% - group_by(Sensor) %>% + group_by(Sensor) %>% index_by(Date) %>% # group by Date and use it as new index - summarise(MaxC = max(Count))
    #> # A tsibble: 2,755 x 3 [1D] + summarise(MaxC = max(Count))
    #> # A tsibble: 2,755 x 3 [1D] #> # Key: Sensor [4] #> Sensor Date MaxC #> * <chr> <date> <dbl> diff --git a/docs/reference/period.html b/docs/reference/period.html index 709545e1..1e49bedc 100644 --- a/docs/reference/period.html +++ b/docs/reference/period.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0
    @@ -174,8 +174,8 @@

    Value

    Details

    It's a known issue that these attributes will be dropped when using -group_by and mutate together. It is recommended to ungroup first, and -then use mutate.

    +group_by and mutate together. It is recommended to ungroup first, and +then use mutate.

    Index functions

    diff --git a/docs/reference/pull-interval.html b/docs/reference/pull-interval.html index 6f58de7b..4d43794e 100644 --- a/docs/reference/pull-interval.html +++ b/docs/reference/pull-interval.html @@ -39,8 +39,7 @@ +components as the "interval" class." /> @@ -81,7 +80,7 @@ tsibble - 0.4.0.9000 + 0.5.0 @@ -143,14 +142,11 @@

    Extract time interval from a vector

    Assuming regularly spaced time, the pull_interval() returns a list of time -components as the "interval" class; the time_unit() returns the value of -time units.

    +components as the "interval" class.

    -
    pull_interval(x)
    -
    -time_unit(x)
    +
    pull_interval(x)

    Arguments

    @@ -164,21 +160,19 @@

    Arg

    Value

    -

    pull_interval(): an "interval" class (a list) includes "year", -"quarter", "month", #' "week", "day", "hour", "minute", "second", "millisecond", +

    an "interval" class (a list) includes "year", +"quarter", "month", "week", "day", "hour", "minute", "second", "millisecond", "microsecond", "nanosecond", "unit".

    Details

    -

    The pull_interval() and time_unit() make a tsibble extensible to +

    index_valid() and pull_interval() make a tsibble extensible to support custom time index.

    Examples

    x <- seq(as.Date("2017-10-01"), as.Date("2017-10-31"), by = 3) -pull_interval(x)
    #> 3D
    # at two months interval ---- -x <- yearmonth(seq(2016, 2018, by = 0.5)) -time_unit(x)
    #> [1] 6
    +pull_interval(x)
    #> 3D
    @@ -155,7 +155,7 @@

    Objects exported from other packages

    These objects are imported from other packages. Follow the links below to see their documentation.

    -
    dplyr

    group_size, n_groups, group_indices, group_vars, groups, ungroup, group_by, mutate, filter, slice, select, rename, arrange, summarise, summarize, transmute, distinct, full_join, inner_join, left_join, right_join, semi_join, anti_join, %>%

    +
    dplyr

    group_size, n_groups, group_indices, group_vars, groups, ungroup, group_by, mutate, filter, slice, select, rename, arrange, summarise, summarize, transmute, distinct, full_join, inner_join, left_join, right_join, semi_join, anti_join, %>%

    pillar

    type_sum, obj_sum, is_vector_s3, pillar_shaft

    diff --git a/docs/reference/regular.html b/docs/reference/regular.html index c2f9854a..fceef56c 100644 --- a/docs/reference/regular.html +++ b/docs/reference/regular.html @@ -82,7 +82,7 @@ tsibble - 0.4.0.9000 + 0.5.0 diff --git a/docs/reference/slide.html b/docs/reference/slide.html index 7405a1d2..17659715 100644 --- a/docs/reference/slide.html +++ b/docs/reference/slide.html @@ -84,7 +84,7 @@ tsibble - 0.4.0.9000 + 0.5.0 diff --git a/docs/reference/slide2.html b/docs/reference/slide2.html index ed30d59b..0392f2a7 100644 --- a/docs/reference/slide2.html +++ b/docs/reference/slide2.html @@ -84,7 +84,7 @@ tsibble - 0.4.0.9000 + 0.5.0 @@ -338,10 +338,10 @@

    Examp #> #>
    ## window over 2 months pedestrian %>% - filter(Sensor == "Southern Cross Station") %>% + filter(Sensor == "Southern Cross Station") %>% index_by(yrmth = yearmonth(Date_Time)) %>% nest(-yrmth) %>% - mutate(ma = slide_dbl(data, ~ mean(do.call(rbind, .)$Count), .size = 2))
    #> # A tibble: 24 x 3 + mutate(ma = slide_dbl(data, ~ mean(do.call(rbind, .)$Count), .size = 2))
    #> # A tibble: 24 x 3 #> yrmth data ma #> * <mth> <list> <dbl> #> 1 2015 Jan <tsibble [744 × 5]> NA @@ -361,9 +361,9 @@

    Examp tibble::tibble(fitted = fitted(fit), resid = residuals(fit)) } pedestrian %>% - filter(Date <= as.Date("2015-01-31")) %>% + filter(Date <= as.Date("2015-01-31")) %>% nest(-Sensor) %>% - mutate(diag = purrr::map(data, ~ pslide_dfr(., my_diag, .size = 48)))

    #> # A tibble: 3 x 3 + mutate(diag = purrr::map(data, ~ pslide_dfr(., my_diag, .size = 48)))
    #> # A tibble: 3 x 3 #> Sensor data diag #> * <chr> <list> <list> #> 1 Birrarung Marr <tsibble [744 × 4]> <tibble [33,457 × 2]> diff --git a/docs/reference/slider.html b/docs/reference/slider.html index 43b5b9b8..59d6a821 100644 --- a/docs/reference/slider.html +++ b/docs/reference/slider.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0
    diff --git a/docs/reference/split-by.html b/docs/reference/split-by.html index 2035cd7e..1ed28af8 100644 --- a/docs/reference/split-by.html +++ b/docs/reference/split-by.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0 diff --git a/docs/reference/stretch.html b/docs/reference/stretch.html index c0c4a16a..7e0ebdc8 100644 --- a/docs/reference/stretch.html +++ b/docs/reference/stretch.html @@ -84,7 +84,7 @@ tsibble - 0.4.0.9000 + 0.5.0 diff --git a/docs/reference/stretch2.html b/docs/reference/stretch2.html index 5e0e6d0c..12c9b366 100644 --- a/docs/reference/stretch2.html +++ b/docs/reference/stretch2.html @@ -84,7 +84,7 @@ tsibble - 0.4.0.9000 + 0.5.0 diff --git a/docs/reference/stretcher.html b/docs/reference/stretcher.html index f30f920a..b569a1d6 100644 --- a/docs/reference/stretcher.html +++ b/docs/reference/stretcher.html @@ -6,7 +6,7 @@ -Splits the input to a list according to the stretching window size. — stretcher • tsibble +Split the input to a list according to the stretching window size. — stretcher • tsibble @@ -36,9 +36,9 @@ - + - + @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0 @@ -133,14 +133,14 @@
    -

    Splits the input to a list according to the stretching window size.

    +

    Split the input to a list according to the stretching window size.

    @@ -153,7 +153,7 @@

    Arg

    - + @@ -170,7 +170,7 @@

    Arg

    - +
    .x

    An objects to be splitted.

    An objects to be split.

    .size
    ...

    Multiple objects to be splitted in parallel.

    Multiple objects to be split in parallel.

    diff --git a/docs/reference/tidyverse.html b/docs/reference/tidyverse.html index 36f45a09..1bc53926 100644 --- a/docs/reference/tidyverse.html +++ b/docs/reference/tidyverse.html @@ -91,7 +91,7 @@ tsibble - 0.4.0.9000 + 0.5.0 @@ -153,14 +153,14 @@

    Tidyverse methods for tsibble

      -
    • arrange(): if not arranging key and index in past-to-future order, a warning is +

    • arrange(): if not arranging key and index in past-to-future order, a warning is likely to be issued.

    • -
    • slice(): if row numbers are not in ascending order, a warning is likely to +

    • slice(): if row numbers are not in ascending order, a warning is likely to be issued.

    • -
    • select(): keeps the variables you mention as well as the index.

    • -
    • transmute(): keeps the variable you operate on, as well as the index and key.

    • -
    • The column-wise verbs, including select(), transmute(), summarise(), -mutate() & transmute(), have an additional argument of .drop = FALSE for +

    • select(): keeps the variables you mention as well as the index.

    • +
    • transmute(): keeps the variable you operate on, as well as the index and key.

    • +
    • The column-wise verbs, including select(), transmute(), summarise(), +mutate() & transmute(), have an additional argument of .drop = FALSE for tsibble. The index variable cannot be dropped for a tsibble. If any key variable is changed, it will validate whether it's a tsibble internally. Turning .drop = TRUE converts to a tibble first and then do the operations.

    • @@ -169,62 +169,62 @@

      Tidyverse methods for tsibble

    # S3 method for tbl_ts
    -left_join(x, y, by = NULL, copy = FALSE,
    +left_join(x, y, by = NULL, copy = FALSE,
       suffix = c(".x", ".y"), ...)
     
     # S3 method for tbl_ts
    -right_join(x, y, by = NULL, copy = FALSE,
    +right_join(x, y, by = NULL, copy = FALSE,
       suffix = c(".x", ".y"), ...)
     
     # S3 method for tbl_ts
    -inner_join(x, y, by = NULL, copy = FALSE,
    +inner_join(x, y, by = NULL, copy = FALSE,
       suffix = c(".x", ".y"), ...)
     
     # S3 method for tbl_ts
    -full_join(x, y, by = NULL, copy = FALSE,
    +full_join(x, y, by = NULL, copy = FALSE,
       suffix = c(".x", ".y"), ...)
     
     # S3 method for tbl_ts
    -semi_join(x, y, by = NULL, copy = FALSE, ...)
    +semi_join(x, y, by = NULL, copy = FALSE, ...)
     
     # S3 method for tbl_ts
    -anti_join(x, y, by = NULL, copy = FALSE, ...)
    +anti_join(x, y, by = NULL, copy = FALSE, ...)
     
     # S3 method for tbl_ts
    -arrange(.data, ...)
    +arrange(.data, ...)
     
     # S3 method for grouped_ts
    -arrange(.data, ..., .by_group = FALSE)
    +arrange(.data, ..., .by_group = FALSE)
     
     # S3 method for tbl_ts
    -filter(.data, ...)
    +filter(.data, ...)
     
     # S3 method for tbl_ts
    -slice(.data, ...)
    +slice(.data, ...)
     
     # S3 method for tbl_ts
    -select(.data, ..., .drop = FALSE)
    +select(.data, ..., .drop = FALSE)
     
     # S3 method for tbl_ts
    -rename(.data, ...)
    +rename(.data, ...)
     
     # S3 method for tbl_ts
    -mutate(.data, ..., .drop = FALSE)
    +mutate(.data, ..., .drop = FALSE)
     
     # S3 method for tbl_ts
    -transmute(.data, ..., .drop = FALSE)
    +transmute(.data, ..., .drop = FALSE)
     
     # S3 method for tbl_ts
    -summarise(.data, ..., .drop = FALSE)
    +summarise(.data, ..., .drop = FALSE)
     
     # S3 method for tbl_ts
    -summarize(.data, ..., .drop = FALSE)
    +summarize(.data, ..., .drop = FALSE)
     
     # S3 method for tbl_ts
    -group_by(.data, ..., add = FALSE)
    +group_by(.data, ..., add = FALSE)
     
     # S3 method for grouped_ts
    -ungroup(x, ...)
    +ungroup(x, ...)
     
     # S3 method for tbl_ts
     gather(data, key = "key", value = "value", ...,
    @@ -296,7 +296,7 @@ 

    Arg add -

    When add = FALSE, the default, group_by() will +

    When add = FALSE, the default, group_by() will override existing groups. To add to the existing groups, use add = TRUE.

    @@ -380,7 +380,7 @@

    Arg .preserve

    Optionally, list-columns to preserve in the output. These will be duplicated in the same way as atomic vectors. This has -dplyr::select semantics so you can preserve multiple variables with +dplyr::select semantics so you can preserve multiple variables with .preserve = c(x, y) or .preserve = starts_with("list").

    @@ -388,14 +388,14 @@

    Arg

    Details

    Examples

    # Sum over sensors ---- pedestrian %>% - summarise(Total = sum(Count))
    #> # A tsibble: 17,542 x 2 [1h] + summarise(Total = sum(Count))
    #> # A tsibble: 17,542 x 2 [1h] #> Date_Time Total #> * <dttm> <int> #> 1 2015-01-01 00:00:00 2866 @@ -411,7 +411,7 @@

    Examp #> # ... with 17,532 more rows

    # Sum over sensors by days ---- pedestrian %>% index_by(Date) %>% - summarise(Total = sum(Count))
    #> # A tsibble: 731 x 2 [1D] + summarise(Total = sum(Count))
    #> # A tsibble: 731 x 2 [1D] #> Date Total #> * <date> <int> #> 1 2015-01-01 18079 @@ -426,12 +426,12 @@

    Examp #> 10 2015-01-10 30904 #> # ... with 721 more rows

    ## .drop = TRUE ---- pedestrian %>% - summarise(Total = sum(Count), .drop = TRUE)
    #> # A tibble: 1 x 1 + summarise(Total = sum(Count), .drop = TRUE)
    #> # A tibble: 1 x 1 #> Total #> <int> #> 1 45494418
    tourism %>% - group_by(Region, State) %>% - summarise(geo_trips = sum(Trips))
    #> # A tsibble: 5,852 x 4 [1Q] + group_by(Region, State) %>% + summarise(geo_trips = sum(Trips))
    #> # A tsibble: 5,852 x 4 [1Q] #> # Key: Region | State [77] #> # Groups: Region [77] #> Region State Quarter geo_trips @@ -493,7 +493,7 @@

    Examp #> 2 Bourke Street Mall (North) <tsibble [16,414 × 4]> #> 3 QV Market-Elizabeth St (West) <tsibble [17,526 × 4]> #> 4 Southern Cross Station <tsibble [17,539 × 4]>

    pedestrian %>% - group_by(Sensor) %>% + group_by(Sensor) %>% nest()
    #> # A tibble: 4 x 2 #> Sensor data #> * <chr> <list> diff --git a/docs/reference/tile.html b/docs/reference/tile.html index 6eeae2ed..481787c0 100644 --- a/docs/reference/tile.html +++ b/docs/reference/tile.html @@ -84,7 +84,7 @@ tsibble - 0.4.0.9000 + 0.5.0
    diff --git a/docs/reference/tile2.html b/docs/reference/tile2.html index 922675d3..b2dc3c83 100644 --- a/docs/reference/tile2.html +++ b/docs/reference/tile2.html @@ -84,7 +84,7 @@ tsibble - 0.4.0.9000 + 0.5.0 diff --git a/docs/reference/tiler.html b/docs/reference/tiler.html index d8077a8e..238565ff 100644 --- a/docs/reference/tiler.html +++ b/docs/reference/tiler.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0 diff --git a/docs/reference/time_unit.html b/docs/reference/time_unit.html new file mode 100644 index 00000000..d2473bd4 --- /dev/null +++ b/docs/reference/time_unit.html @@ -0,0 +1,208 @@ + + + + + + + + +Extract time unit from a vector — time_unit • tsibble + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    Extract time unit from a vector

    + +
    + +
    time_unit(x)
    + +

    Arguments

    + + + + + + +
    x

    A vector of POSIXt, Date, yearmonth, yearquarter, difftime, +hms, integer, numeric.

    + + +

    Examples

    +
    x <- yearmonth(seq(2016, 2018, by = 0.5)) +time_unit(x)
    #> [1] 6
    +
    + +
    + + +
    + + + + + + + + + diff --git a/docs/reference/tourism.html b/docs/reference/tourism.html index 8c6ed6ba..e3bab144 100644 --- a/docs/reference/tourism.html +++ b/docs/reference/tourism.html @@ -80,7 +80,7 @@ tsibble - 0.4.0.9000 + 0.5.0 @@ -184,8 +184,8 @@

    Examp # nesting and crossed structure key(tourism)
    #> Region | State, Purpose
    # Total trips over geographical regions tourism %>% - group_by(Region, State) %>% - summarise(Total_Trips = sum(Trips))
    #> # A tsibble: 5,852 x 4 [1Q] + group_by(Region, State) %>% + summarise(Total_Trips = sum(Trips))
    #> # A tsibble: 5,852 x 4 [1Q] #> # Key: Region | State [77] #> # Groups: Region [77] #> Region State Quarter Total_Trips diff --git a/docs/reference/tsibble-package.html b/docs/reference/tsibble-package.html index 7ed53648..33574133 100644 --- a/docs/reference/tsibble-package.html +++ b/docs/reference/tsibble-package.html @@ -39,10 +39,9 @@ +The tsibble package provides a data class of tbl_ts to represent tidy +temporal-context data. A tsibble consists of a time index, key, and other +measured variables in a data-centric format, which is built on top of the tibble." /> @@ -83,7 +82,7 @@ tsibble - 0.4.0.9000 + 0.5.0
    @@ -145,10 +144,9 @@

    tsibble: tidy temporal data frames and tools

    -The tsibble package provides a data class of tbl_ts to store and manage -temporal data frames in a "tidy" form. A tsibble consists of a time index, -key, and other measured variables in a data-centric format, which is built on -top of the tibble.

    +The tsibble package provides a data class of tbl_ts to represent tidy +temporal-context data. A tsibble consists of a time index, key, and other +measured variables in a data-centric format, which is built on top of the tibble.

    @@ -156,12 +154,13 @@

    tsibble: tidy temporal data frames and tools

    Index

    -

    The time indices are no longer an implicit attribute (for example, the tsp attribute -in a ts object), but preserved as the essential data component of the tsibble. A +

    The time indices are preserved as the essential data component of the tsibble, +instead of implicit attribute (for example, the tsp attribute in a ts object). A few index classes, such as Date, POSIXct, and difftime, forms the basis of the tsibble, with new additions yearweek, yearmonth, and yearquarter representing year-week, year-month, and year-quarter respectively. Any arbitrary -index class are also supported, including zoo::yearmth and zoo::yearqtr. +index class are also supported, including zoo::yearmth, zoo::yearqtr, and +nanotime. For a tbl_ts of regular interval, a choice of index representation has to be made. For example, a monthly data should correspond to time index created by yearmonth or zoo::yearmth, diff --git a/docs/reference/tsibble.html b/docs/reference/tsibble.html index bd12d931..2188e275 100644 --- a/docs/reference/tsibble.html +++ b/docs/reference/tsibble.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0 @@ -166,8 +166,9 @@

    Arg regular -

    Regular time interval (TRUE) or irregular (FALSE). TRUE -finds the greatest common divisor of positive time distances as the interval.

    +

    Regular time interval (TRUE) or irregular (FALSE). The +interval is determined by the greatest common divisor of positive time distances, +if TRUE.

    @@ -182,12 +183,13 @@

    Details

    Index

    -

    The time indices are no longer an implicit attribute (for example, the tsp attribute -in a ts object), but preserved as the essential data component of the tsibble. A +

    The time indices are preserved as the essential data component of the tsibble, +instead of implicit attribute (for example, the tsp attribute in a ts object). A few index classes, such as Date, POSIXct, and difftime, forms the basis of the tsibble, with new additions yearweek, yearmonth, and yearquarter representing year-week, year-month, and year-quarter respectively. Any arbitrary -index class are also supported, including zoo::yearmth and zoo::yearqtr. +index class are also supported, including zoo::yearmth, zoo::yearqtr, and +nanotime. For a tbl_ts of regular interval, a choice of index representation has to be made. For example, a monthly data should correspond to time index created by yearmonth or zoo::yearmth, diff --git a/docs/reference/units_since.html b/docs/reference/units_since.html index 9765b9a6..226ad206 100644 --- a/docs/reference/units_since.html +++ b/docs/reference/units_since.html @@ -79,7 +79,7 @@ tsibble - 0.4.0.9000 + 0.5.0 diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 2e6f24fe..d593a90e 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -117,6 +117,9 @@ https://pkg.earo.me/tsibble/reference/tiler.html + + https://pkg.earo.me/tsibble/reference/time_unit.html + https://pkg.earo.me/tsibble/reference/tourism.html