Skip to content

Commit

Permalink
Merge pull request #73 from RaymondBalise/CRAN_check_problem
Browse files Browse the repository at this point in the history
Cran check problem
  • Loading branch information
RaymondBalise authored Sep 16, 2024
2 parents 18d28b4 + 7d5925d commit 5a78195
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tidyREDCap
Title: Helper Functions for Working with 'REDCap' Data
Version: 1.1.1
Version: 1.1.2
Authors@R:
c(person(
given = "Raymond",
Expand Down Expand Up @@ -58,7 +58,7 @@ Description:
developed at Vanderbilt University.
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
Depends: R (>= 3.5.0)
Imports:
cli,
Expand Down
15 changes: 14 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
# tidyREDCap 1.1.2 (CRAN release)

* Fix issues reported by CRAN with Linux and old R Windows (4.3.3) saying

```
✖ These names are duplicated:
* "record_id" at locations 1 and 2.
```

+ Update roxygen2 version (Thank you for Will Beasley)
+ Fix .data$ was depreciated in `tidyselect` (https://github.com/r-lib/tidyselect/issues/169)
+ Fixed missing global bindings caused by `tidyselect` fix.

# tidyREDCap 1.1.1 (CRAN release)

## New features

* Add `make_yes_no()` function to convert "checked" or "yes"-like answers to
"Yes" and other answers to "No or Unknown".
* Add `make_yes_no_unknown()` function to convert "checked" or "yes"-like
answers to "Yes"", unchecked or "no"-like answers to "No" and other answers to
answers to "Yes", unchecked or "no"-like answers to "No" and other answers to
"Unknown".

## Fixes/Changes
Expand Down
12 changes: 9 additions & 3 deletions R/make_choose_all_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ make_choose_all_table <- function(df, variable) {

}

# fix no visible bindings for global variables in CRAN check
blah <- NULL
value <- NULL
What <- NULL
Count <- NULL

counts <- the_vars_df |>
dplyr::mutate(dplyr::across(tidyselect::everything(), ~ . %in% c("1", "Checked"))) %>%
dplyr::mutate(dplyr::across(
Expand All @@ -92,7 +98,7 @@ make_choose_all_table <- function(df, variable) {
)) %>%
dplyr::summarise(across(everything(), ~ sum(.x, na.rm = TRUE))) %>%
dplyr::mutate(blah = "x") %>%
tidyr::pivot_longer(-.data$blah, names_to = "thingy", values_to = "Count")
tidyr::pivot_longer(-`blah`, names_to = "thingy", values_to = "Count")

aTable <-
counts %>%
Expand All @@ -101,8 +107,8 @@ make_choose_all_table <- function(df, variable) {
getLabel2(df, .x)
}) %>%
tibble::enframe(name = NULL) %>% # new variable is value
dplyr::rename("What" = .data$value) %>%
dplyr::rename("What" = `value`) %>%
dplyr::bind_cols(counts) %>%
dplyr::select(.data$What, .data$Count)
dplyr::select(`What`, `Count`)
aTable
}

0 comments on commit 5a78195

Please sign in to comment.