-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
104 lines (89 loc) · 5.19 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
<!-- badges: start -->
[](https://github.com/ercbk/ebtools/actions)
<!-- badges: end -->
## Eric's Data Science Toolbox
A personal R package of miscellaneous data science functions
## Installation
Install from [GitHub](https://github.com/ercbk/ebtools) with:
``` r
# install.packages("remotes")
remotes::install_github("ercbk/ebtools")
```
## What's in it
```{r gt, echo=FALSE, asis=TRUE}
library(dplyr, warn.conflicts = FALSE)
library(gt)
dtw_html <- gt::html(as.character(htmltools::a(href = "https://dynamictimewarping.github.io/", "dtw")))
pkg_tbl <- tibble::tibble(
Type = c("Geospatial", "Preprocessing", "Statistics", "Statistics", "Time Series", "Time Series", "Time Series", "Time Series", "Time Series", "Time Series", "Time Series", "Time Series", "Time Series"),
Function = c("add_spatial_lags", "to_js_array", "cles", "get_boot_ci", "add_mase_scale_feat", "add_tsfeatures", "create_dtw_grids", "descale_by_mase", "dtw_dist_gridsearch", "prewhitened_ccf", "scale_by_mase", "test_fable_resids", "test_lm_resids"),
Description = c("Adds spatial lags of a numeric variable to a dataframe",
"Creates js array column.",
"Calculates the Common Language Effect Size (CLES)",
"Calculates bootstrapped confidence intervals for a statistic.",
"Adds a scale feature by using a factor derived from the MASE error function",
"Adds 20 time series features from the tsfeatures package",
"Creates a nested, parameter grid list.",
"Back-transforms a group time series that has been scaled by a factor derived from the MASE error function.",
"Performs a grid search using a list of parameter grids and a list of distance functions",
"Prewhitens time series, calculates cross-correlation coefficients, and returns statistically significant values.",
"Scales a group time series by using a factor derived from the MASE error function.",
"Checks residuals of multiple fable models for autocorrelation using the Ljung-Box test",
"Checks residuals of multiple lm models for autocorrelation using Breusch-Godfrey and Durbin-Watson tests."),
comp_pkgs = c("spdep", "dataui", "", "", "", "", "dtwclust", "", "dtwclust", "", "", "fable", ""),
function_urls = c("https://ercbk.github.io/ebtools/reference/add_spatial_lags.html",
"https://ercbk.github.io/ebtools/reference/to_js_array.html",
"https://ercbk.github.io/ebtools/reference/cles.html",
"https://ercbk.github.io/ebtools/reference/get_boot_ci.html",
"https://ercbk.github.io/ebtools/reference/add_mase_scale_feat.html",
"https://ercbk.github.io/ebtools/reference/add_tsfeatures.html",
"https://ercbk.github.io/ebtools/reference/create_dtw_grids.html",
"https://ercbk.github.io/ebtools/reference/descale_by_mase.html",
"https://ercbk.github.io/ebtools/reference/dtw_dist_gridsearch.html",
"https://ercbk.github.io/ebtools/reference/prewhitened_ccf.html",
"https://ercbk.github.io/ebtools/reference/scale_by_mase.html",
"https://ercbk.github.io/ebtools/reference/test_fable_resids.html",
"https://ercbk.github.io/ebtools/reference/test_lm_resids.html"),
package_urls = c("https://r-spatial.github.io/spdep/",
"https://timelyportfolio.github.io/dataui/",
NA, NA, NA, NA,
"https://github.com/asardaes/dtwclust",
NA,
"https://github.com/asardaes/dtwclust",
NA, NA,
"https://fable.tidyverts.org/",
NA)
) |>
mutate(fun_html = purrr::map2(function_urls, Function, ~htmltools::a(href = .x, .y)),
fun_url = purrr::map(fun_html, ~gt::html(as.character(.x))),
pkg_html = purrr::map2(package_urls, comp_pkgs, ~htmltools::a(href = .x, .y)),
pkg_url = purrr::map(pkg_html, ~gt::html(as.character(.x))),
dtw_url = list("","","","","", "", dtw_html, "", dtw_html, "", "", "", "")) |>
tidyr::unite("pkg_url", pkg_url, dtw_url, sep = " <br> ") |> # newly added b/c gt::col_merge error
mutate(pkg_url = purrr::map(pkg_url, ~gt::html(.x))) |> # newly added b/c gt::col_merge error
relocate(fun_url, .before = "Function") |>
select(Type, Function = fun_url, Description, comp_pkgs = pkg_url)
pkg_tbl %>%
group_by(Type) |>
gt() |>
cols_label(comp_pkgs = "Complementary Packages") |>
# errored because (I guess) target column was a list column. Think its a bug. Used new code above to do this manually. Might be fixed in the future.
# cols_merge(
# c(comp_pkgs, dtw_url),
# hide_columns = c(dtw_url),
# pattern = "{1}<br>{2}"
# ) %>%
as_raw_html()
```