Skip to content

Commit

Permalink
Merge pull request #3 from abichat/taxonomy
Browse files Browse the repository at this point in the history
`step_taxonomy()`
  • Loading branch information
abichat authored Apr 16, 2024
2 parents cb13d19 + 47aecc9 commit 367473a
Show file tree
Hide file tree
Showing 30 changed files with 510 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/R-CMD-check-prdev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
extra-packages: |
any::rcmdcheck
yatah
needs: check

- uses: r-lib/actions/check-r-package@v2
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
extra-packages: |
any::rcmdcheck
yatah
needs: check

- uses: r-lib/actions/check-r-package@v2
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
extra-packages: |
any::pkgdown
local::.
yatah
needs: website

- name: Build site
Expand Down
17 changes: 17 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,39 @@ S3method(bake,step_select_background)
S3method(bake,step_select_cv)
S3method(bake,step_select_kruskal)
S3method(bake,step_select_wilcoxon)
S3method(bake,step_taxonomy)
S3method(prep,step_aggregate_hclust)
S3method(prep,step_aggregate_list)
S3method(prep,step_rownormalize_tss)
S3method(prep,step_select_background)
S3method(prep,step_select_cv)
S3method(prep,step_select_kruskal)
S3method(prep,step_select_wilcoxon)
S3method(prep,step_taxonomy)
S3method(print,step_aggregate_hclust)
S3method(print,step_aggregate_list)
S3method(print,step_rownormalize_tss)
S3method(print,step_select_background)
S3method(print,step_select_cv)
S3method(print,step_select_kruskal)
S3method(print,step_select_wilcoxon)
S3method(print,step_taxonomy)
S3method(required_pkgs,step_aggregate_hclust)
S3method(required_pkgs,step_aggregate_list)
S3method(required_pkgs,step_rownormalize_tss)
S3method(required_pkgs,step_select_background)
S3method(required_pkgs,step_select_cv)
S3method(required_pkgs,step_select_kruskal)
S3method(required_pkgs,step_select_wilcoxon)
S3method(required_pkgs,step_taxonomy)
S3method(tidy,step_aggregate_hclust)
S3method(tidy,step_aggregate_list)
S3method(tidy,step_rownormalize_tss)
S3method(tidy,step_select_background)
S3method(tidy,step_select_cv)
S3method(tidy,step_select_kruskal)
S3method(tidy,step_select_wilcoxon)
S3method(tidy,step_taxonomy)
export("%>%")
export(cv)
export(step_aggregate_hclust)
Expand All @@ -37,12 +49,14 @@ export(step_select_background)
export(step_select_cv)
export(step_select_kruskal)
export(step_select_wilcoxon)
export(step_taxonomy)
export(var_to_keep)
importFrom(dplyr,filter)
importFrom(dplyr,if_else)
importFrom(dplyr,left_join)
importFrom(dplyr,mutate)
importFrom(dplyr,pull)
importFrom(generics,required_pkgs)
importFrom(generics,tidy)
importFrom(magrittr,"%>%")
importFrom(recipes,add_step)
Expand All @@ -59,7 +73,9 @@ importFrom(recipes,step)
importFrom(rlang,.data)
importFrom(rlang,.env)
importFrom(rlang,abort)
importFrom(rlang,call2)
importFrom(rlang,enquos)
importFrom(rlang,eval_tidy)
importFrom(stats,as.formula)
importFrom(stats,cutree)
importFrom(stats,dist)
Expand All @@ -70,4 +86,5 @@ importFrom(stats,sd)
importFrom(stats,wilcox.test)
importFrom(tibble,enframe)
importFrom(tibble,tibble)
importFrom(tidyr,expand_grid)
importFrom(tidyr,unnest_longer)
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# scimo 0.0.1.9000

* New function `step_taxonomy()`.

* Replace superseded `juice()` with `bake(new_data = NULL)` to align with current practices (#1).


Expand Down
7 changes: 7 additions & 0 deletions R/aggregate_hclust.R
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,10 @@ tidy.step_aggregate_hclust <- function(x, ...) {
res$id <- x$id
res
}


#' @rdname required_pkgs.scimo
#' @export
required_pkgs.step_aggregate_hclust <- function(x, ...) {
c("scimo")
}
9 changes: 8 additions & 1 deletion R/aggregate_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ step_aggregate_list <- function(recipe, ..., role = "predictor",

#' @importFrom recipes step
step_aggregate_list_new <- function(terms, role, trained,
list_agg, fun_agg, others,name_others,
list_agg, fun_agg, others, name_others,
res, prefix, keep_original_cols,
skip, id) {

Expand Down Expand Up @@ -224,3 +224,10 @@ tidy.step_aggregate_list <- function(x, ...) {
res$id <- x$id
res
}


#' @rdname required_pkgs.scimo
#' @export
required_pkgs.step_aggregate_list <- function(x, ...) {
c("scimo")
}
9 changes: 9 additions & 0 deletions R/checks.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@ check_binary <- function(x, name_x = "x") {

invisible(x)
}


check_not_null <- function(x, name_x = "x") {
if (is.null(x)) {
rlang::abort(paste0("`", name_x, "` must be specified and can't be `NULL`."))
}

invisible(x)
}
6 changes: 6 additions & 0 deletions R/rownormalize_tss.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,9 @@ tidy.step_rownormalize_tss <- function(x, ...) {
res
}


#' @rdname required_pkgs.scimo
#' @export
required_pkgs.step_rownormalize_tss <- function(x, ...) {
c("scimo")
}
2 changes: 1 addition & 1 deletion R/scimo-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"_PACKAGE"

## usethis namespace: start
#' @importFrom generics tidy
#' @importFrom generics required_pkgs tidy
#' @importFrom recipes prep bake
#' @importFrom tibble tibble
## usethis namespace: end
Expand Down
7 changes: 7 additions & 0 deletions R/select_background.R
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,10 @@ tidy.step_select_background <- function(x, ...) {
res$id <- x$id
res
}


#' @rdname required_pkgs.scimo
#' @export
required_pkgs.step_select_background <- function(x, ...) {
c("scimo")
}
6 changes: 6 additions & 0 deletions R/select_cv.R
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,9 @@ tidy.step_select_cv <- function(x, ...) {
res
}


#' @rdname required_pkgs.scimo
#' @export
required_pkgs.step_select_cv <- function(x, ...) {
c("scimo")
}
7 changes: 7 additions & 0 deletions R/select_kruskal.R
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,10 @@ tidy.step_select_kruskal <- function(x, ...) {
res$id <- x$id
res
}


#' @rdname required_pkgs.scimo
#' @export
required_pkgs.step_select_kruskal <- function(x, ...) {
c("scimo")
}
7 changes: 7 additions & 0 deletions R/select_wilcoxon.R
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,10 @@ tidy.step_select_wilcoxon <- function(x, ...) {
res$id <- x$id
res
}


#' @rdname required_pkgs.scimo
#' @export
required_pkgs.step_select_wilcoxon <- function(x, ...) {
c("scimo")
}
Loading

0 comments on commit 367473a

Please sign in to comment.