Skip to content

2023 spring cleaning #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
^CODE_OF_CONDUCT\.md$
^\.github$
^codecov\.yml$
^README\.Rmd$
3 changes: 3 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'oldrel-2'}
- {os: ubuntu-latest, r: 'oldrel-3'}
- {os: ubuntu-latest, r: 'oldrel-4'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
shell: Rscript {0}

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.Rproj.user
.DS_Store
inst/doc
docs
16 changes: 8 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Version: 0.0.1.1
Authors@R: c(
person("Marly", "Gotti", , "[email protected]", role = c("aut", "cre")),
person("Max", "Kuhn", , "[email protected]", role = "aut"),
person(given = "Posit Software, PBC", role = c("cph", "fnd"))
person("Posit Software, PBC", role = c("cph", "fnd"))
)
Description: A modeling package compiling applicability domain methods in
R. It combines different methods to measure the amount of
Expand All @@ -17,15 +17,15 @@ URL: https://github.com/tidymodels/applicable,
BugReports: https://github.com/tidymodels/applicable/issues
Depends:
ggplot2,
R (>= 3.4)
R (>= 3.6)
Imports:
dplyr,
glue,
hardhat (>= 0.1.2),
hardhat (>= 1.3.0),
Matrix,
proxyC,
purrr,
rlang,
rlang (>= 1.1.1),
stats,
tibble,
tidyr,
Expand All @@ -35,17 +35,17 @@ Suggests:
covr,
knitr,
modeldata,
recipes (>= 0.1.7),
recipes (>= 1.0.8),
rmarkdown,
spelling,
testthat (>= 3.0.0),
testthat (>= 3.2.0),
xml2
VignetteBuilder:
knitr
Config/Needs/website: tidyverse/tidytemplate
Config/testthat/edition: 3
Encoding: UTF-8
Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Config/Needs/website: tidyverse/tidytemplate
Config/testthat/edition: 3
4 changes: 1 addition & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export(autoplot.apd_pca)
export(autoplot.apd_similarity)
export(score)
export(score.default)
import(rlang)
importFrom(Matrix,Matrix)
importFrom(Matrix,colSums)
importFrom(dplyr,"%>%")
Expand Down Expand Up @@ -59,9 +60,6 @@ importFrom(hardhat,validate_prediction_size)
importFrom(proxyC,simil)
importFrom(purrr,map2_dfc)
importFrom(purrr,map_dfc)
importFrom(rlang,abort)
importFrom(rlang,arg_match)
importFrom(rlang,enquos)
importFrom(stats,approx)
importFrom(stats,ecdf)
importFrom(stats,prcomp)
Expand Down
47 changes: 0 additions & 47 deletions R/0.R

This file was deleted.

46 changes: 44 additions & 2 deletions R/applicable-package.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,50 @@
#' @keywords internal
"_PACKAGE"

# The following block is used by usethis to automatically manage
# roxygen namespace tags. Modify with care!
## usethis namespace: start

#' @import rlang
#' @importFrom dplyr %>%
#' @importFrom dplyr count
#' @importFrom dplyr group_by
#' @importFrom dplyr matches
#' @importFrom dplyr mutate
#' @importFrom dplyr mutate_all
#' @importFrom dplyr rename_all
#' @importFrom dplyr sample_n
#' @importFrom dplyr select
#' @importFrom dplyr slice
#' @importFrom dplyr starts_with
#' @importFrom dplyr ungroup
#' @importFrom ggplot2 ggplot geom_step xlab ylab aes autoplot
#' @importFrom glue glue
#' @importFrom hardhat forge
#' @importFrom hardhat mold
#' @importFrom hardhat new_model
#' @importFrom hardhat validate_prediction_size
#' @importFrom Matrix Matrix colSums
#' @importFrom proxyC simil
#' @importFrom purrr map_dfc
#' @importFrom purrr map2_dfc
#' @importFrom stats approx
#' @importFrom stats ecdf
#' @importFrom stats prcomp
#' @importFrom stats predict
#' @importFrom stats quantile
#' @importFrom stats setNames
#' @importFrom tibble as_tibble
#' @importFrom tibble tibble
#' @importFrom tidyr gather
#' @importFrom tidyselect vars_select
#' @importFrom utils globalVariables
## usethis namespace: end

# ------------------------------------------------------------------------------
# global variable" check
# nocov
# nocov end
# Reduce false positives when R CMD check runs its "no visible binding for
utils::globalVariables(
c("cumulative", "n", "sim", "percentile", "component", "value")
)
NULL
4 changes: 2 additions & 2 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ NULL
#' @return \item{okc_binary_train,okc_binary_test}{data frame frames with 61 columns}
#'
#' @source
#' Kim (2015), "OkCupid Data for Introductory Statistics and Data Science Courses", _Journal of Statistics Education_, Volume 23, Number 2. \url{https://www.tandfonline.com/doi/abs/10.1080/10691898.2015.11889737}
#' Kim (2015), "OkCupid Data for Introductory Statistics and Data Science Courses", _Journal of Statistics Education_, Volume 23, Number 2. \doi{10.1080/10691898.2015.11889737}
#'
#' Kuhn and Johnson (2020), _Feature Engineering and Selection_, Chapman and Hall/CRC . \url{https://bookdown.org/max/FES/} and \url{https://github.com/topepo/FES}
#'
Expand Down Expand Up @@ -60,7 +60,7 @@ NULL
#' Data as an End of Semester Regression Project," \emph{Journal of Statistics
#' Education}, Volume 19, Number 3.
#'
#' \url{https://www.cityofames.org/government/departments-divisions-a-h/city-assessor}
#' `https://www.cityofames.org/government/departments-divisions-a-h/city-assessor`
#'
#' \url{http://jse.amstat.org/v19n3/decock/DataDocumentation.txt}
#'
Expand Down
2 changes: 1 addition & 1 deletion R/print.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ print.apd_hat_values <- function(x, ...) {
#' tr_x <- matrix(
#' sample(0:1, size = 20 * 50, prob = rep(.5, 2), replace = TRUE),
#' ncol = 20
#' )
#' )
#' model <- apd_similarity(tr_x)
#' print(model)
#' @export
Expand Down
3 changes: 1 addition & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ knitr::opts_chunk$set(
)

options(rlang__backtrace_on_error = "reminder")

```

# applicable <img src="man/figures/logo.png" align="right"/>
Expand Down Expand Up @@ -58,7 +57,7 @@ To learn about how to use applicable, check out the vignettes:

This project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.

- For questions and discussions about tidymodels packages, modeling, and machine learning, please [post on RStudio Community](https://community.rstudio.com/new-topic?category_id=15&tags=tidymodels,question).
- For questions and discussions about tidymodels packages, modeling, and machine learning, please [post on Posit Community](https://community.rstudio.com/new-topic?category_id=15&tags=tidymodels,question).

- If you think you have encountered a bug, please [submit an issue](https://github.com/tidymodels/applicable/issues).

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html).
By contributing to this project, you agree to abide by its terms.

- For questions and discussions about tidymodels packages, modeling, and
machine learning, please [post on RStudio
machine learning, please [post on Posit
Community](https://community.rstudio.com/new-topic?category_id=15&tags=tidymodels,question).

- If you think you have encountered a bug, please [submit an
Expand Down
16 changes: 5 additions & 11 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
url: https://applicable.tidymodels.org

url: https://applicable.tidymodels.org/
template:
package: tidytemplate
bootstrap: 5
bslib:
primary: "#CA225E"

primary: '#CA225E'
includes:
in_header: |
<script defer data-domain="applicable.tidymodels.org,all.tidymodels.org" src="https://plausible.io/js/plausible.js"></script>

# https://github.com/tidyverse/tidytemplate for css

in_header: |
<script defer data-domain="applicable.tidymodels.org,all.tidymodels.org" src="https://plausible.io/js/plausible.js"></script>
development:
mode: auto


figures:
fig.width: 8
fig.height: 5.75

23 changes: 13 additions & 10 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
al
Ames
Chemoinformatics
CMD
CRC
Chemoinformatics
Codecov
De
doi
et
extensibility
Gillet
Jaccard
Lifecycle
Netzeva
OkCupid
pca
pcas
pre
PBC
QSAR
Springer
tibble
X'X
al
doi
et
extensibility
funder
intercal
CMD
pca
pcas
pre
reprex
tibble
tidymodels
2 changes: 1 addition & 1 deletion man/ames_new.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/okc_binary.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/print.apd_similarity.Rd

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

20 changes: 12 additions & 8 deletions tests/testthat/_snaps/hat_values-fit.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,33 @@

Code
new_apd_hat_values(blueprint = hardhat::default_xy_blueprint())
Error <simpleError>
argument "XtX_inv" is missing, with no default
Condition
Error in `new_apd_hat_values()`:
! argument "XtX_inv" is missing, with no default

# `new_apd_hat_values` fails when blueprint is numeric

Code
new_apd_hat_values(XtX_inv = 1, blueprint = 1)
Error <rlang_error>
blueprint should be a blueprint, not a numeric.
Condition
Error in `hardhat::new_model()`:
! `blueprint` must be a <hardhat_blueprint>, not the number 1.

# `apd_hat_values` fails when matrix has more predictors than samples

Code
apd_hat_values(bad_data)
Error <rlang_error>
The number of columns must be less than the number of rows.
Condition
Error in `apd_hat_values_bridge()`:
! The number of columns must be less than the number of rows.

# `apd_hat_values` fails when the matrix X^tX is singular

Code
apd_hat_values(bad_data)
Error <rlang_error>
Unable to compute the hat values of the matrix X of
Condition
Error in `get_inv()`:
! Unable to compute the hat values of the matrix X of
predictors because the matrix resulting from multiplying
the transpose of X by X is singular.

Loading
Loading