-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from vwmaus/drop-dependencies
Drop dependencies
- Loading branch information
Showing
62 changed files
with
1,126 additions
and
1,945 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,8 @@ examples_x64 | |
^LICENSE\.md$ | ||
^dtwSat\.Rproj$ | ||
^\.github$ | ||
^doc$ | ||
^Meta$ | ||
|
||
vignettes.awk | ||
_pkgdown.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | ||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
on: | ||
push: | ||
branches: [main, master] | ||
pull_request: | ||
branches: [main, master] | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
name: pkgdown | ||
|
||
jobs: | ||
pkgdown: | ||
runs-on: ubuntu-latest | ||
# Only restrict concurrency for non-PR jobs | ||
concurrency: | ||
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: r-lib/actions/setup-pandoc@v2 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::pkgdown, local::. | ||
needs: website | ||
|
||
- name: Build site | ||
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) | ||
shell: Rscript {0} | ||
|
||
- name: Deploy to GitHub pages 🚀 | ||
if: github.event_name != 'pull_request' | ||
uses: JamesIves/github-pages-deploy-action@v4.4.1 | ||
with: | ||
clean: false | ||
branch: gh-pages | ||
folder: docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,5 @@ CRAN-SUBMISSION | |
src/symbols.rds | ||
*.o | ||
*.so | ||
/doc/ | ||
/Meta/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export(create_patterns) | ||
export(plot_patterns) | ||
S3method(plot,twdtw_knn1) | ||
S3method(predict,twdtw_knn1) | ||
S3method(print,twdtw_knn1) | ||
export(shift_dates) | ||
export(twdtw_knn1) | ||
import(ggplot2) | ||
import(sf) | ||
import(stars) | ||
import(twdtw) | ||
importFrom(mgcv,gam) | ||
importFrom(mgcv,predict.gam) | ||
importFrom(mgcv,s) | ||
importFrom(reshape2,melt) | ||
importFrom(rlang,.data) | ||
importFrom(scales,date_format) | ||
importFrom(scales,percent) | ||
importFrom(scales,pretty_breaks) | ||
importFrom(proxy,dist) | ||
importFrom(stats,as.formula) | ||
importFrom(stats,predict) | ||
importFrom(stats,setNames) | ||
importFrom(tidyr,nest) | ||
importFrom(tidyr,pivot_longer) | ||
importFrom(tidyr,pivot_wider) | ||
importFrom(tidyr,unnest) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#' Plot Patterns from twdtw-knn1 model | ||
#' | ||
#' This function visualizes time series patterns from the \code{"twdtw_knn1"} model. | ||
#' It produces a multi-faceted plot, where each facet represents a different time series | ||
#' label from the model's data. Within each facet, different bands or indices (attributes) | ||
#' are plotted as distinct lines, differentiated by color. | ||
#' | ||
#' @param x A model of class \code{"twdtw_knn1"}. | ||
#' | ||
#' @param bands A character vector specifying the bands or indices to plot. | ||
#' If NULL (default), all available bands or indices in the data will be plotted. | ||
#' | ||
#' @param ... Additional arguments passed to \code{\link[ggplot2]{ggplot}}. Currently not used. | ||
#' | ||
#' @return A \code{\link[ggplot2]{ggplot}} object displaying the time series patterns. | ||
#' | ||
#' @seealso twdtw_knn1 | ||
#' | ||
#' @inherit twdtw_knn1 examples | ||
#' | ||
#' @export | ||
plot.twdtw_knn1 <- function(x, bands = NULL, ...) { | ||
|
||
# Convert the list of time series data into a long-format data.frame | ||
df <- x$data | ||
df$id <- 1:nrow(df) | ||
df <- unnest(df, cols = 'observations') | ||
|
||
# Select bands | ||
if(!is.null(bands)){ | ||
df <- df[c('id', 'time', 'label', bands)] | ||
} | ||
|
||
# Pivote data into long format for ggplot2 | ||
df <- pivot_longer(df, !c('id', 'label', 'time'), names_to = "band", values_to = "value") | ||
|
||
# Construct the ggplot | ||
gp <- ggplot(df, aes(x = .data$time, y = .data$value, colour = .data$band, group = interaction(.data$id, .data$band))) + | ||
geom_line() + | ||
facet_wrap(~label) + | ||
theme(legend.position = "bottom") + | ||
guides(colour = guide_legend(title = "Bands")) + | ||
ylab("Value") + | ||
xlab("Time") | ||
|
||
return(gp) | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.