diff --git a/.Rbuildignore b/.Rbuildignore index 80c5f94..bb4d82a 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -7,3 +7,5 @@ README.Rmd vignettes/*_cache* vignettes/*_files* +^doc$ +^Meta$ diff --git a/.gitignore b/.gitignore index beedb98..048611c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,6 @@ data/ *.Rproj *.rda inst/doc +/doc/ +/Meta/ +.DS_Store diff --git a/DESCRIPTION b/DESCRIPTION index 155eb31..bea1489 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Type: Package Package: gratis Title: Generating Time Series with Diverse and Controllable Characteristics -Version: 1.0.7 +Version: 1.0.8 Authors@R: c( person("Yanfei", "Kang", , "yanfeikang@buaa.edu.cn", role = "aut", comment = c(ORCID = "0000-0001-8769-6650")), @@ -54,4 +54,4 @@ Encoding: UTF-8 LazyLoad: yes NeedsCompilation: no Repository: CRAN -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.3 diff --git a/NEWS.md b/NEWS.md index 37110a9..4166bd3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# gratis 1.0.8 + +* simulate_target(): examples updated to use dplyr::reframe() instead of summarise() + to comply with dplyr 1.2.0. + # gratis 1.0.7 * Fixed dependency issue on CRAN. diff --git a/R/simulate_target.R b/R/simulate_target.R index 2f34ea6..c4a36dd 100644 --- a/R/simulate_target.R +++ b/R/simulate_target.R @@ -42,9 +42,10 @@ #' df %>% #' as_tibble() %>% #' group_by(key) %>% -#' dplyr::summarise(value = my_features(value), -#' feature=c("entropy","acf1", "acf2"), -#' .groups = "drop") +#' dplyr::reframe( +#' value = my_features(value), +#' feature=c("entropy","acf1", "acf2") +#' ) #' autoplot(df) #' # Simulate time series similar to an existing series #' my_features <- function(y) { diff --git a/README.Rmd b/README.Rmd index ae3a360..7e89db4 100644 --- a/README.Rmd +++ b/README.Rmd @@ -44,7 +44,7 @@ devtools::install_github("ykang/gratis") ### Tutorial video -Watch [this Youtube video](https://www.youtube.com/watch?v=F3lWECtFa44) provided by [Prof. Rob Hyndman](https://robjhyndman.com/). +Watch [this YouTube video](https://www.youtube.com/watch?v=F3lWECtFa44) provided by [Prof. Rob Hyndman](https://robjhyndman.com/). ### Load the package @@ -56,7 +56,7 @@ library(feasts) ### Generate diverse time series ```{r} -set.seed(1) +set.seed(27) mar_model(seasonal_periods=12) %>% generate(length=120, nseries=2) %>% autoplot(value) @@ -83,12 +83,12 @@ my_features <- function(y) { df <- generate_target( length = 60, feature_function = my_features, target = c(0.5, 0.9, 0.8) ) -df %>% +df %>% as_tibble() %>% group_by(key) %>% - summarise(value = my_features(value), - feature=c("entropy","acf1", "acf2"), - .groups = "drop") + reframe(value = my_features(value), + feature=c("entropy","acf1", "acf2") + ) autoplot(df) ``` diff --git a/README.md b/README.md index 180dcb4..bcff8ce 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ library(feasts) ### Generate diverse time series ``` r -set.seed(1) +set.seed(27) mar_model(seasonal_periods=12) %>% generate(length=120, nseries=2) %>% autoplot(value) @@ -82,23 +82,23 @@ df <- generate_target( df %>% as_tibble() %>% group_by(key) %>% - summarise(value = my_features(value), - feature=c("entropy","acf1", "acf2"), - .groups = "drop") + reframe(value = my_features(value), + feature=c("entropy","acf1", "acf2") + ) #> # A tibble: 30 × 3 #> key value feature -#> -#> 1 Series 1 0.533 entropy -#> 2 Series 1 0.850 acf1 -#> 3 Series 1 0.735 acf2 -#> 4 Series 10 0.478 entropy -#> 5 Series 10 0.880 acf1 -#> 6 Series 10 0.764 acf2 -#> 7 Series 2 0.507 entropy -#> 8 Series 2 0.890 acf1 -#> 9 Series 2 0.899 acf2 -#> 10 Series 3 0.454 entropy -#> # … with 20 more rows +#> +#> 1 Series 1 0.509 entropy +#> 2 Series 1 0.906 acf1 +#> 3 Series 1 0.787 acf2 +#> 4 Series 10 0.465 entropy +#> 5 Series 10 0.896 acf1 +#> 6 Series 10 0.775 acf2 +#> 7 Series 2 0.483 entropy +#> 8 Series 2 0.901 acf1 +#> 9 Series 2 0.812 acf2 +#> 10 Series 3 0.504 entropy +#> # ℹ 20 more rows autoplot(df) ``` @@ -117,15 +117,15 @@ APP](https://ebsmonash.shinyapps.io/tsgeneration/) ## See also -- R package `tsfeatures` from [GitHub - Repository](https://github.com/robjhyndman/tsfeatures). +- R package `tsfeatures` from [GitHub + Repository](https://github.com/robjhyndman/tsfeatures). ## References -- Kang, Y., Hyndman, R., and Li, F. (2020). **GRATIS**: - **G**ene**RA**ting **TI**me **S**eries with diverse and controllable - characteristics. [Statistical Analysis and Data - Mining](https://doi.org/10.1002/sam.11461). +- Kang, Y., Hyndman, R.J, and Li, F. (2020). **GRATIS**: + **G**ene**RA**ting **TI**me **S**eries with diverse and controllable + characteristics. [Statistical Analysis and Data + Mining](https://doi.org/10.1002/sam.11461). ## License diff --git a/man/figures/README-unnamed-chunk-2-1.png b/man/figures/README-unnamed-chunk-2-1.png index cc68739..705fe19 100644 Binary files a/man/figures/README-unnamed-chunk-2-1.png and b/man/figures/README-unnamed-chunk-2-1.png differ diff --git a/man/figures/README-unnamed-chunk-3-1.png b/man/figures/README-unnamed-chunk-3-1.png index 1769245..f6abd62 100644 Binary files a/man/figures/README-unnamed-chunk-3-1.png and b/man/figures/README-unnamed-chunk-3-1.png differ diff --git a/man/figures/README-unnamed-chunk-4-1.png b/man/figures/README-unnamed-chunk-4-1.png index 3cd29fc..32b8eec 100644 Binary files a/man/figures/README-unnamed-chunk-4-1.png and b/man/figures/README-unnamed-chunk-4-1.png differ diff --git a/man/mar_model.Rd b/man/mar_model.Rd index 19f00f5..270a999 100644 --- a/man/mar_model.Rd +++ b/man/mar_model.Rd @@ -74,7 +74,7 @@ The sigmas are uniformly sampled on (1,5) and the weights are uniformly sampled The number of components is uniformly sampled on \{1,2,3,4,5\}. } \examples{ -\dontshow{if (require("fGarch", quietly=TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (require("fGarch", quietly=TRUE)) withAutoprint(\{ # examplesIf} n <- 100 # Quarterly MAR model with randomly selected parameters model1 <- mar_model(seasonal_periods = 4) diff --git a/man/rmixnorm_ts.Rd b/man/rmixnorm_ts.Rd index 1738732..5bd7ba3 100644 --- a/man/rmixnorm_ts.Rd +++ b/man/rmixnorm_ts.Rd @@ -25,7 +25,7 @@ This function simulates random samples from a finite mixture of Gaussian distrib where the mean from each components are AR(p) process. } \examples{ -\dontshow{if (require("fGarch", quietly=TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (require("fGarch", quietly=TRUE)) withAutoprint(\{ # examplesIf} n <- 1000 means.ar.par.list <- list(c(0, 0.8), c(0, 0.6, 0.3)) require("fGarch") diff --git a/man/simulate_target.Rd b/man/simulate_target.Rd index b6d3c46..4581213 100644 --- a/man/simulate_target.Rd +++ b/man/simulate_target.Rd @@ -83,9 +83,10 @@ df <- generate_target( df \%>\% as_tibble() \%>\% group_by(key) \%>\% - dplyr::summarise(value = my_features(value), - feature=c("entropy","acf1", "acf2"), - .groups = "drop") + dplyr::reframe( + value = my_features(value), + feature=c("entropy","acf1", "acf2") + ) autoplot(df) # Simulate time series similar to an existing series my_features <- function(y) { diff --git a/vignettes/QuickStart.Rmd b/vignettes/QuickStart.Rmd index f76aba8..44e26c7 100644 --- a/vignettes/QuickStart.Rmd +++ b/vignettes/QuickStart.Rmd @@ -114,9 +114,9 @@ df <- generate_target( df %>% as_tibble() %>% group_by(key) %>% - summarise(value = my_features(value), - feature=c("entropy","acf1", "acf2"), - .groups = "drop") + reframe(value = my_features(value), + feature=c("entropy","acf1", "acf2") + ) df %>% autoplot(value) ```