sbfnk / RBi
Showing 2 of 2 files from the diff.

@@ -20,18 +20,20 @@
Loading
20 20
    stop("'x' must be a 'libbi' object or a file name or a list of data frames.")
21 21
  }
22 22
23 -
  max_np <- max(vapply(samples[setdiff(names(samples), "clock")], function (y) {
24 -
    if (is.data.frame(y) && "np" %in% colnames(y)) {
25 -
      max(y$np)
26 -
    } else {
27 -
      0
28 -
    }
29 -
  }, 0))
23 +
  if (length(samples) > 0) {
24 +
    max_np <- max(vapply(samples[setdiff(names(samples), "clock")], function (y) {
25 +
      if (is.data.frame(y) && "np" %in% colnames(y)) {
26 +
        max(y$np)
27 +
      } else {
28 +
        0
29 +
      }
30 +
    }, 0))
30 31
31 -
  if (missing(np)) np <- sample(seq_len(max_np), 1)
32 -
  find_np <- ifelse(tolower(np) == "last", max_np, np)
33 -
  if (find_np > max_np) {
34 -
    stop("np requested greater than the maximum ", max_np)
32 +
    if (missing(np)) np <- sample(seq_len(max_np), 1)
33 +
    find_np <- ifelse(tolower(np) == "last", max_np, np)
34 +
    if (find_np > max_np) {
35 +
      stop("np requested greater than the maximum ", max_np)
36 +
    }
35 37
  }
36 38
37 39
  ret <- lapply(samples[setdiff(names(samples), "clock")], function(y) {

@@ -645,9 +645,9 @@
Loading
645 645
    } else {
646 646
      file.copy(source_file_name, target_file_name)
647 647
    }
648 -
  } else if ("list" %in% class(data)) {
648 +
  } else if ("list" %in% class(data) && length(data) > 0) {
649 649
    vars <- data
650 -
  } else if (is.null(data)) {
650 +
  } else { ## can't do anything with given 'data'
651 651
    if (file == "output") {
652 652
      x$run_flag <- FALSE
653 653
      x$output_file_name <- character(0)
Files Coverage
R 97.85%
Project Totals (17 files) 97.85%
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