@@ -22,8 +22,11 @@
Loading
22 22
                     order = FALSE,
23 23
                     x_name = substitute(x),
24 24
                     error = TRUE) {
25 -
  lifecycle::deprecate_soft("0.5.1", "check_classes()", NULL,
26 -
                            "Please use chk::chk_is(), chk::chk_s3_class(), chk::chk_s4_class(), or chk::check_values() instead.")  
25 +
  lifecycle::deprecate_soft(
26 +
    "0.5.1", 
27 +
    "check_classes()", 
28 +
    NULL,
29 +
    "Please use chk::chk_is(), chk::chk_s3_class(), chk::chk_s4_class(), or chk::check_values() instead.")  
27 30
  
28 31
  x_name <- chk_deparse(x_name)
29 32
  

@@ -1,14 +1,19 @@
Loading
1 1
#' Check Proportions
2 -
#' 
3 -
#' Checks if x is proportions vector - non-missing dbls between 0 and 1 that sum to 1.
2 +
#'
3 +
#' Checks if x is proportions vector - non-missing dbls between 0 and 1 that sum
4 +
#' to 1.
4 5
#'
5 6
#' @inheritParams params
6 -
#' 
7 +
#'
7 8
#' @return An invisible copy of x (if it doesn't throw an error).
8 9
#' @export
9 10
check_props <- function(x, x_name = substitute(x),
10 11
                       error = TRUE) {
11 -
  lifecycle::deprecate_soft("0.5.1", "check_props()", "chk::check_values()")
12 +
  lifecycle::deprecate_soft(
13 +
    "0.5.1", 
14 +
    "check_props()", 
15 +
    NULL,
16 +
    "Use chk::chk_range() and then chk::chk_equal(sum(x), 1) instead.")
12 17
  x_name <- chk_deparse(x_name)
13 18
14 19
  check_flag_internal(error)

@@ -17,7 +17,12 @@
Loading
17 17
check_missing_colnames <- function(x, colnames, 
18 18
                                   x_name = substitute(x),
19 19
                                   error = TRUE) {
20 -
  lifecycle::deprecate_soft("0.5.1", "check_missing_colnames()", "chk::chk_not_subset(names())")
20 +
  lifecycle::deprecate_soft(
21 +
    "0.5.1", 
22 +
    "check_missing_colnames()", 
23 +
    NULL, 
24 +
    "Please use chk::chk_not_subset(names()) instead."
25 +
  )
21 26
  
22 27
  x_name <- chk_deparse(x_name)
23 28
  

@@ -1,19 +1,28 @@
Loading
1 1
#' Check Number of Characters
2 -
#' 
2 +
#'
3 3
#' Checks the number of characters in the elements of an object.
4 4
#'
5 5
#' @inheritParams params
6 -
#' @param nchar A flag indicating whether x should have characters or a missing value indicating no requirements or a count or count range of the number of characters.
7 -
#' 
6 +
#' @param nchar A flag indicating whether x should have characters or a missing
7 +
#'   value indicating no requirements or a count or count range of the number of
8 +
#'   characters.
9 +
#'
8 10
#' @return An invisible copy of x (if it doesn't throw an error).
9 11
#' @seealso \code{\link{check_pattern}} and \code{\link{check_regex}}
10 12
#' @export
11 13
#'
12 14
#' @examples
13 15
#' check_nchar(c("foo", "bar"), nchar = 3)
14 -
check_nchar <- function(x, nchar = TRUE, x_name = substitute(x),
15 -
                         error = TRUE) {
16 -
  lifecycle::deprecate_soft("0.5.1", "check_nchar()", "chk::chk_match()")
16 +
check_nchar <- function(x, 
17 +
                        nchar = TRUE, 
18 +
                        x_name = substitute(x),
19 +
                        error = TRUE) {
20 +
  lifecycle::deprecate_soft(
21 +
    "0.5.1", 
22 +
    "check_nchar()", 
23 +
    NULL, 
24 +
    "Please use chk::chk_equal(), chk::chk_range(), chk::chk_subset() etc with nchar() instead."
25 +
  )
17 26
  x_name <- chk_deparse(x_name)
18 27
19 28
  check_flag_internal(error)

@@ -1,15 +1,17 @@
Loading
1 1
#' Check Attributes
2 -
#' 
2 +
#'
3 3
#' Checks an objects attributes.
4 4
#'
5 5
#' @inheritParams check_list
6 -
#' @param names A flag specifying whether names should be considered an attribute.
7 -
#' @param class A flag specifying whether class should be considered an attribute.
8 -
#' 
6 +
#' @param names A flag specifying whether names should be considered an
7 +
#'   attribute.
8 +
#' @param class A flag specifying whether class should be considered an
9 +
#'   attribute.
10 +
#'
9 11
#' @return An invisible copy of x (if it doesn't throw an error).
10 12
#' @seealso \code{\link{check_list}}
11 13
#' @export
12 -
#' 
14 +
#'
13 15
#' @examples
14 16
#' x <- 1
15 17
#' attributes(x) <- list(y = 2L)
@@ -22,7 +24,12 @@
Loading
22 24
                             class = TRUE,
23 25
                             x_name = substitute(x),
24 26
                             error = TRUE) {
25 -
  lifecycle::deprecate_soft("0.5.1", "check_attributes()", NULL)
27 +
  lifecycle::deprecate_soft(
28 +
    "0.5.1", 
29 +
    "check_attributes()", 
30 +
    NULL,
31 +
    "Pull out attributes with `attributes()` and then use appropriate chk function"
32 +
  )
26 33
  x_name <- chk_deparse(x_name)
27 34
  
28 35
  check_flag_internal(names)
@@ -63,12 +70,16 @@
Loading
63 70
                                class = TRUE,
64 71
                                x_name = substitute(x),
65 72
                                error = TRUE) {
66 -
  lifecycle::deprecate_soft("0.5.1", "check_no_attributes()", NULL)
73 +
  lifecycle::deprecate_soft(
74 +
    "0.5.1", 
75 +
    "check_no_attributes()", 
76 +
    NULL,
77 +
    "Please use chk::chk_null(attributes()) instead"
78 +
  )
67 79
  x_name <- chk_deparse(x_name)
68 80
  
69 81
  check_flag_internal(error)
70 82
  
71 -
  
72 83
  attr <- attributes(x)
73 84
  if(!class) attr$class <- NULL
74 85
  if(!names) attr$names <- NULL
@@ -76,4 +87,3 @@
Loading
76 87
  
77 88
  invisible(x)
78 89
}
79 -

@@ -17,7 +17,12 @@
Loading
17 17
check_missing_names <- function(x, names, 
18 18
                                   x_name = substitute(x),
19 19
                                   error = TRUE) {
20 -
  lifecycle::deprecate_soft("0.5.1", "check_missing_names()", "chk::chk_not_subset(names())")
20 +
  lifecycle::deprecate_soft(
21 +
    "0.5.1", 
22 +
    "check_missing_names()", 
23 +
    NULL,
24 +
    "Please use chk::chk_not_subset(names()) instead."
25 +
  )
21 26
  
22 27
  x_name <- chk_deparse(x_name)
23 28
  

@@ -1,16 +1,19 @@
Loading
1 1
#' Check Row Bind
2 -
#' 
3 -
#' Checks whether a data frame has the same columns of the same classes as a second data frame which means they can be \code{\link{rbind}}ed without a problem.
2 +
#'
3 +
#' Checks whether a data frame has the same columns of the same classes as a
4 +
#' second data frame which means they can be \code{\link{rbind}}ed without a
5 +
#' problem.
4 6
#'
5 7
#' @inheritParams params
6 8
#' @param x The first data frame.
7 9
#' @param y The second data frame.
8 -
#' @param order A flag indicating whether the columns have to occur in the same order.
9 -
#' 
10 +
#' @param order A flag indicating whether the columns have to occur in the same
11 +
#'   order.
12 +
#'
10 13
#' @return An invisible copy of x (if it doesn't throw an error).
11 14
#' @seealso \code{\link{check_join}}
12 15
#' @export
13 -
#' 
16 +
#'
14 17
#' @examples
15 18
#' check_rbind(datasets::mtcars, datasets::mtcars)
16 19
check_rbind <- function(x,
@@ -20,7 +23,7 @@
Loading
20 23
                        x_name = substitute(x),
21 24
                        y_name = substitute(y),
22 25
                        error = TRUE) {
23 -
  lifecycle::deprecate_soft("0.5.1", "check_rbind()", "chk::chk_join()")
26 +
  lifecycle::deprecate_soft("0.5.1", "check_rbind()", "chk::check_data()")
24 27
  x_name <- chk_deparse(x_name)
25 28
  y_name <- chk_deparse(y_name)
26 29
  
Files Coverage
R 92.56%
Project Totals (51 files) 92.56%
1
comment: false
2

3
coverage:
4
  status:
5
    project:
6
      default:
7
        target: auto
8
        threshold: 1%
9
        informational: true
10
    patch:
11
      default:
12
        target: auto
13
        threshold: 1%
14
        informational: true
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading