Skip to content

Commit

Permalink
fix remaining errors & warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderDevisscher committed Apr 30, 2024
1 parent 4e684d6 commit 7544f08
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
Imports:
dplyr (>= 1.1.4),
magrittr (>= 2.0.3)
magrittr (>= 2.0.3),
rlang (>= 1.1.3)
2 changes: 1 addition & 1 deletion R/check.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
#' 0 = object doesn't exist in enviroment


check <- function(x){tryCatch(if(class(x) == 'logical') 1 else 1, error=function(e) 0)}
check <- function(x){tryCatch(if(is.logical(class(x))) 1 else 1, error=function(e) 0)}
10 changes: 6 additions & 4 deletions R/colcompare.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#' present in y and not in x.
#'
#' @examples
#' \dontrun{
#' # create example dataframes
#' super_sleepers <- data.frame(rating=1:4,
#' animal=c('koala', 'hedgehog', 'sloth', 'panda'),
Expand All @@ -22,9 +23,10 @@
#' super_actives <- data.frame(rating=1:4,
#' animal=c('kangeroo', 'wolf', 'jaguar', 'tiger'),
#' country=c('Australia', 'Italy', 'Peru', 'China'),
#' avg_active_hours=c(16, 15, 8, 10)))
#' avg_active_hours=c(16, 15, 8, 10))
#'
#' colcompare(super_sleepers, super_actives)
#' }
#'
#' @importFrom magrittr %>%

Expand All @@ -47,7 +49,7 @@ colcompare <- function(x, y){
test_xANDy <- test_xANDy$test_xANDy

if(check(test_xANDy) == 1){
if(!is_empty(test_xANDy)){
if(!rlang::is_empty(test_xANDy)){
error <- paste0("Kolommen met verschillende schrijfwijze: \n",
test_xANDy)
writeLines(error)
Expand All @@ -60,7 +62,7 @@ colcompare <- function(x, y){
test_xiny <- test_xiny$test_xiny

if(check(test_xiny)==1){
if(!is_empty(test_xiny)){
if(!rlang::is_empty(test_xiny)){
test_xiny <- paste(test_xiny, collapse = ", \n")
error <- paste0("Kolommen uit x die niet in y voorkomen: \n", test_xiny)
writeLines(error)
Expand All @@ -74,7 +76,7 @@ colcompare <- function(x, y){
test_yinx <- test_yinx$test_yinx

if(check(test_yinx)==1){
if(!is_empty(test_yinx)){
if(!rlang::is_empty(test_yinx)){
test_yinx <- paste(test_yinx, collapse = ", \n")
error <- paste0("Kolommen uit y die niet in x voorkomen: ", test_yinx)
writeLines(error)
Expand Down
4 changes: 3 additions & 1 deletion man/colcompare.Rd

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

0 comments on commit 7544f08

Please sign in to comment.