Skip to content
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

Prep release 1.1.0 #344

Merged
merged 6 commits into from
Mar 4, 2024
Merged
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
4 changes: 2 additions & 2 deletions R/add-cols.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
add_shadow <- function(data, ...){

test_if_dots_missing(
missing(...),
"{.fun add_shadow} requires variables to be selected"
dots_empty = missing(...),
msg = "{.fun add_shadow} requires variables to be selected"
)
shadow_df <- dplyr::select(data, ...) %>% as_shadow()

Expand Down
8 changes: 4 additions & 4 deletions R/cast-shadows.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
cast_shadow <- function(data, ...){

test_if_dots_missing(
...,
"{.fun cast_shadow} requires variables to be selected after the data"
dots_empty = missing(...),
msg = "{.fun cast_shadow} requires variables to be selected after the data"
)

shadow_vars <- tibble::as_tibble(as_shadow(dplyr::select(data, ...)))
Expand Down Expand Up @@ -108,8 +108,8 @@ cast_shadow_shift <- function(data, ...){
cast_shadow_shift_label <- function(data, ...){

test_if_dots_missing(
...,
"{.fun cast_shadow_shift_label} requires variables to be selected after the data"
dots_empty = missing(...),
msg = "{.fun cast_shadow_shift_label} requires variables to be selected after the data"
)

shadow_vars <- dplyr::select(data, ...) %>% cast_shadow(...)
Expand Down
4 changes: 2 additions & 2 deletions R/mcar-test.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
#' *Journal of the American Statistical Association* 83 (404):
#' 1198--1202. \doi{10.1080/01621459.1988.10478722}.
#'
#' @note Code is adapted from LittleMCAR() in the now-orphaned {BaylorEdPsych}
#' @note Code is adapted from LittleMCAR() in the now-orphaned `BaylorEdPsych`
#' package: \url{https://rdrr.io/cran/BaylorEdPsych/man/LittleMCAR.html}. Some of
#' code is adapted from Eric Stemmler: \url{https://web.archive.org/web/20201120030409/https://stats-bayes.com/post/2020/08/14/r-function-for-little-s-test-for-data-missing-completely-at-random/}
#' using Maximum likelihood estimation from {norm}.
#' using Maximum likelihood estimation from `norm`.
#'
#' @author Andrew Heiss, \email{andrew@andrewheiss.com}
#'
Expand Down
51 changes: 32 additions & 19 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@ group_by_fun <- function(data, .fun, ...) {
#' }
#' @keywords internal
#' @noRd
test_if_null <- function(x) {
test_if_null <- function(x,
call = rlang::caller_env()) {
# test for null
if (is.null(x)) {
cli::cli_abort(
c(
message = c(
"Input must not be NULL",
"Input is {.cls {class(x)}}"
)
),
call = call
)
}
}
Expand Down Expand Up @@ -128,27 +130,32 @@ test_if_dots_missing <- function(dots_empty,
#'
#' @keywords internal
#' @noRd
test_if_dataframe <- function(x) {
test_if_dataframe <- function(x,
arg = rlang::caller_arg(x),
call = rlang::caller_env()) {
# test for dataframe
if (!inherits(x, "data.frame")) {
cli::cli_abort(
c(
message = c(
"Input must inherit from {.cls data.frame}",
"We see class: {.cls {class(x)}}"
)
),
call = call
)
}
}

test_if_any_shade <- function(x) {
test_if_any_shade <- function(x,
call = rlang::caller_env()) {
# test for dataframe
test_if_dataframe(x)
if (!any_shade(x)) {
cli::format_error(
c(
cli::cli_abort(
message = c(
"Input must contain a shade column.",
"See {.code ?shade}, {.code ?shade}, and {.code ?bind_shadow}"
)
),
call = call
)
}
}
Expand Down Expand Up @@ -251,36 +258,42 @@ vecIsFALSE <- Vectorize(isFALSE)

are_any_false <- function(x, ...) any(vecIsFALSE(x), ...)

check_btn_0_1 <- function(prop) {
check_btn_0_1 <- function(prop,
call = rlang::caller_env()) {
if (prop < 0 || prop > 1) {
cli::cli_abort(
c(
message = c(
"{.var prop} must be between 0 and 1",
"{.var prop} is {prop}"
)
),
call = call
)
}
}

check_is_integer <- function(x) {
check_is_integer <- function(x,
call = rlang::caller_env()) {
if (x < 0) {
cli::cli_abort(
c(
message = c(
"{.var x} must be greater than 0",
"{.var x} is {.val {x}}"
)
),
call = call
)
}
vctrs::vec_cast(x, integer())
}

check_is_scalar <- function(x) {
check_is_scalar <- function(x,
call = rlang::caller_env()) {
if (length(x) != 1) {
cli::cli_abort(
c(
message = c(
"{.var x} must be length 1",
"{.var x} is {x}, and {.var x} has length: {length(x)}"
)
),
call = call
)
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ which both return output ordered by the number of missing values.
miss_var_summary(airquality)
#> # A tibble: 6 × 3
#> variable n_miss pct_miss
#> <chr> <int> <dbl>
#> <chr> <int> <num>
#> 1 Ozone 37 24.2
#> 2 Solar.R 7 4.58
#> 3 Wind 0 0
Expand Down Expand Up @@ -354,7 +354,7 @@ airquality %>%
#> # A tibble: 25 × 4
#> # Groups: Month [5]
#> Month variable n_miss pct_miss
#> <int> <chr> <int> <dbl>
#> <int> <chr> <int> <num>
#> 1 5 Ozone 5 16.1
#> 2 5 Solar.R 4 12.9
#> 3 5 Wind 0 0
Expand Down
26 changes: 5 additions & 21 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,21 @@ There were no ERRORs or WARNINGs, and one NOTE:

```
Found the following (possibly) invalid URLs:
URL: https://web.archive.org/web/20201120030409/https://stats-bayes.com/post/2020/08/14/r-function-for-little-s-test-for-data-missing-completely-at-random/
From: man/mcar_test.Rd
Status: Error
Message: Failed to connect to web.archive.org port 443 after 21108 ms: Timed out
URL: https://www.ncei.noaa.gov/products/land-based-station/global-historical-climatology-network-daily
From: inst/doc/special-missing-values.html
Status: Error
Message: Empty reply from server
URL: https://www.researchgate.net/publication/2758672_Missing_Data_in_Interactive_High-Dimensional_Data_Visualization
From: man/as_shadow.Rd
inst/doc/getting-started-w-naniar.html
inst/doc/special-missing-values.html
README.md
Status: 403
Message: Forbidden

Found the following (possibly) invalid DOIs:
DOI: 10.18637/jss.v105.i07
From: DESCRIPTION
inst/CITATION
Status: 404
Message: Not Found
```

The DOI in the CITATION is for a new JSS publication that will be registered after publication on CRAN.
Navigating to the website works on my machine, but I note that the NCEI website states in a banner:

> Please note: Due to a system outage, many NCEI systems are currently unavailable. We are working to resolve these issues as soon as possible. We apologize for any inconvenience.

The other links all work locally for me on my machine, and checking with `wget` locally they also work. I'm not sure how to best proceed with these?
Which makes me think that perhaps this is an issue related to that?

## Reverse dependencies

We checked 3 reverse dependencies (2 from CRAN + 1 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package.
We checked 6 reverse dependencies (5 from CRAN + 1 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package.

* We saw 0 new problems
* We failed to check 0 packages
Expand Down
4 changes: 2 additions & 2 deletions man/mcar_test.Rd

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

31 changes: 16 additions & 15 deletions revdep/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# Platform

|field |value |
|:--------|:-------------------------------------------------------------------------------------------|
|version |R version 4.2.1 (2022-06-23) |
|os |macOS Monterey 12.3.1 |
|system |aarch64, darwin20 |
|ui |RStudio |
|language |(EN) |
|collate |en_US.UTF-8 |
|ctype |en_US.UTF-8 |
|tz |Australia/Hobart |
|date |2023-02-01 |
|rstudio |2022.12.0+353 Elsbeth Geranium (desktop) |
|pandoc |2.19.2 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/ (via rmarkdown) |
|field |value |
|:--------|:-----------------------------------|
|version |R version 4.3.3 (2024-02-29) |
|os |macOS Sonoma 14.3.1 |
|system |aarch64, darwin20 |
|ui |RStudio |
|language |(EN) |
|collate |en_US.UTF-8 |
|ctype |en_US.UTF-8 |
|tz |Australia/Melbourne |
|date |2024-03-04 |
|rstudio |2023.12.1+402 Ocean Storm (desktop) |
|pandoc |NA |

# Dependencies

|package |old |new |Δ |
|:-------|:-----|:-----|:--|
|naniar |0.6.1 |0.9.0 |* |
|forcats |NA |1.0.0 |* |
|naniar |1.0.0 |1.1.0 |* |
|ggplot2 |NA |3.5.0 |* |
|viridis |NA |0.6.5 |* |

# Revdeps

2 changes: 1 addition & 1 deletion revdep/cran.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## revdepcheck results

We checked 3 reverse dependencies (2 from CRAN + 1 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package.
We checked 6 reverse dependencies (5 from CRAN + 1 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package.

* We saw 0 new problems
* We failed to check 0 packages
Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/_snaps/add-shadow.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Code
add_shadow(dat)
Warning <lifecycle_warning_deprecated>
The `value` argument of `names<-` must have the same length as `x` as of tibble 3.0.0.
Error <vctrs_error_incompatible_size>
Can't recycle `..1` (size 5) to match `..2` (size 0).
Condition
Error in `add_shadow()`:
! argument must be specified
{.fun add_shadow} requires variables to be selected

9 changes: 0 additions & 9 deletions tests/testthat/_snaps/add-shadow.new.md

This file was deleted.

8 changes: 4 additions & 4 deletions tests/testthat/_snaps/as-shadow.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Code
as_shadow(0)
Condition
Error in `test_if_dataframe()`:
Error in `as_shadow()`:
! Input must inherit from <data.frame>
We see class: <numeric>

Expand All @@ -12,7 +12,7 @@
Code
as_shadow("a")
Condition
Error in `test_if_dataframe()`:
Error in `as_shadow()`:
! Input must inherit from <data.frame>
We see class: <character>

Expand All @@ -21,7 +21,7 @@
Code
as_shadow(matrix(airquality))
Condition
Error in `test_if_dataframe()`:
Error in `as_shadow()`:
! Input must inherit from <data.frame>
We see class: <matrix/array>

Expand All @@ -30,7 +30,7 @@
Code
as_shadow(NULL)
Condition
Error in `test_if_null()`:
Error in `as_shadow()`:
! Input must not be NULL
Input is <NULL>

8 changes: 4 additions & 4 deletions tests/testthat/_snaps/cast-shadow-shift-label.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Code
cast_shadow_shift(airquality)
Warning <lifecycle_warning_deprecated>
The `value` argument of `names<-` must have the same length as `x` as of tibble 3.0.0.
Error <vctrs_error_incompatible_size>
Can't recycle `..1` (size 153) to match `..2` (size 0).
Condition
Error in `cast_shadow()`:
! argument must be specified
{.fun cast_shadow} requires variables to be selected after the data

8 changes: 4 additions & 4 deletions tests/testthat/_snaps/cast-shadow-shift.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Code
cast_shadow_shift(airquality)
Warning <lifecycle_warning_deprecated>
The `value` argument of `names<-` must have the same length as `x` as of tibble 3.0.0.
Error <vctrs_error_incompatible_size>
Can't recycle `..1` (size 153) to match `..2` (size 0).
Condition
Error in `cast_shadow()`:
! argument must be specified
{.fun cast_shadow} requires variables to be selected after the data

Loading
Loading