Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
README.Rmd
vignettes/*_cache*
vignettes/*_files*
^doc$
^Meta$
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ data/
*.Rproj
*.rda
inst/doc
/doc/
/Meta/
.DS_Store
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
Expand Down Expand Up @@ -54,4 +54,4 @@ Encoding: UTF-8
LazyLoad: yes
NeedsCompilation: no
Repository: CRAN
RoxygenNote: 7.3.1
RoxygenNote: 7.3.3
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
7 changes: 4 additions & 3 deletions R/simulate_target.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
12 changes: 6 additions & 6 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand All @@ -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)
```

Expand Down
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
#> <chr> <dbl> <chr>
#> 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
#> <chr> <dbl> <chr>
#> 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)
```

Expand All @@ -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

Expand Down
Binary file modified man/figures/README-unnamed-chunk-2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-4-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion man/mar_model.Rd

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

2 changes: 1 addition & 1 deletion man/rmixnorm_ts.Rd

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

7 changes: 4 additions & 3 deletions man/simulate_target.Rd

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

6 changes: 3 additions & 3 deletions vignettes/QuickStart.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```

Expand Down