Showing 1 of 4 files from the diff.
Other files ignored by Codecov

@@ -60,11 +60,17 @@
Loading
60 60
#' @name dialr-phone
61 61
#' @family phone functions
62 62
#' @export
63 -
phone <- function(x, region, show_progress = getOption("dialr.show_progress")) {
64 -
  if (!is.atomic(x))  stop("`x` must be an atomic vector.", call. = FALSE)
65 -
  if (length(x) == 0)  stop("`x` must not be empty.", call. = FALSE)
63 +
phone <- function(x = character(), region = character(),
64 +
                  show_progress = getOption("dialr.show_progress")) {
65 +
  
66 +
  if (!is.atomic(x)) stop("`x` must be an atomic vector.", call. = FALSE)
67 +
68 +
  # if (length(x) >= 1 & length(region) == 0) region <- NA_character_
69 +
  if (length(region) == 0 && length(x) != 0)
70 +
    stop("`region` must be provided. Use `NA` or `\"\"` to parse without a default region.", call. = FALSE)
66 71
  if (length(x) > 1 & length(region) == 1) region <- rep(region, length(x))
67 -
  if (length(x) != length(region)) stop("`x` and `region` vectors must be the same length.", call. = FALSE)
72 +
  if (length(x) != length(region) && length(x) != 0)
73 +
    stop("`x` and `region` vectors must be the same length.", call. = FALSE)
68 74
  
69 75
  region[!is.na(region) & region == ""] <- NA_character_
70 76
  validate_phone_region(region[!is.na(region)])
@@ -79,8 +85,11 @@
Loading
79 85
new_phone <- function(x, region, show_progress = getOption("dialr.show_progress")) {
80 86
  stopifnot(is.character(x))
81 87
  stopifnot(is.character(region))
82 -
  stopifnot(length(x) == length(region))
88 +
  stopifnot(length(x) == length(region) || length(x) == 0)
83 89
90 +
  if (length(x) == 0)
91 +
    return(structure(list(), class = c("phone", "list")))
92 +
  
84 93
  phone_util <- .get_phoneNumberUtil()
85 94
  jfunc <- function(p, r) {
86 95
    .jcall(phone_util,
Files Coverage
R 93.42%
Project Totals (11 files) 93.42%
1
comment: false
2

3
coverage:
4
  status:
5
    project:
6
      default:
7
        target: auto
8
        threshold: 1%
9
    patch:
10
      default:
11
        target: auto
12
        threshold: 1%
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