@@ -67,9 +67,8 @@
Loading
67 67
  # })
68 68
69 69
70 -
  known_layer_cogs_ <<- bind_rows(
71 -
    known_layer_cogs_,
72 -
    tibble(
70 +
  known_layer_cogs_add(
71 +
    tibble::tibble(
73 72
      kind,
74 73
      name,
75 74
      cog_groups = list(cog_groups),

@@ -6,23 +6,46 @@
Loading
6 6
#   cognostics: [String!]! # list of all cognostics names. ex: univariate_counts, univariate_continuous
7 7
# }
8 8
9 -
known_layer_cogs_ <- tibble::tibble(
10 -
  # plot mechanism (ggplot2, rbokeh, plotly, etc.)
11 -
  kind = character(0),
12 -
13 -
  # Name of plot type (boxplot, histogram, density)
14 -
  name = character(0),
15 -
16 -
17 -
  # Automatic cognostics to calculate
18 -
  cog_groups = list(),
19 -
20 -
  # Plot type description
21 -
  description = character(0)
22 -
23 -
  # Creates nested data.frames of every auto_cog provided
24 -
  # fn = list()
25 -
)
9 +
# perform all `<<-` actions within a local environment to avoid
10 +
# a locked package environment if another package wants to add cognostic info
11 +
known_layer_info <- local({
12 +
  known_layer_cogs_ <- tibble::tibble(
13 +
    # plot mechanism (ggplot2, rbokeh, plotly, etc.)
14 +
    kind = character(0),
15 +
16 +
    # Name of plot type (boxplot, histogram, density)
17 +
    name = character(0),
18 +
19 +
20 +
    # Automatic cognostics to calculate
21 +
    cog_groups = list(),
22 +
23 +
    # Plot type description
24 +
    description = character(0)
25 +
26 +
    # Creates nested data.frames of every auto_cog provided
27 +
    # fn = list()
28 +
  )
29 +
30 +
  known_layer_cogs <- function() {
31 +
    known_layer_cogs_
32 +
  }
33 +
  known_layer_cogs_add <- function(new_layer_cogs) {
34 +
    known_layer_cogs_ <<- bind_rows(
35 +
      known_layer_cogs_,
36 +
      new_layer_cogs
37 +
    )
38 +
    invisible(known_layer_cogs())
39 +
  }
40 +
41 +
  list(
42 +
    known_layer_cogs = known_layer_cogs,
43 +
    known_layer_cogs_add = known_layer_cogs_add
44 +
  )
45 +
})
46 +
47 +
known_layer_cogs_fn <- known_layer_info$known_layer_cogs
48 +
known_layer_cogs_add <- known_layer_info$known_layer_cogs_add
26 49
27 50
#' Layer Cognostic groups
28 51
#'
@@ -32,5 +55,5 @@
Loading
32 55
#' @examples
33 56
#' known_layer_cogs()
34 57
known_layer_cogs <- function() {
35 -
  known_layer_cogs_
58 +
  known_layer_cogs_fn()
36 59
}

@@ -1,16 +1,42 @@
Loading
1 1
2 2
3 +
# perform all `<<-` actions within a local environment to avoid
4 +
# a locked package environment if another package wants to add cognostic info
5 +
known_cog_info <- local({
6 +
  known_cog_groups_ <- tibble::tibble(
7 +
    # Name of autocog
8 +
    name = character(0),
9 +
    # Fields required
10 +
    fields = list(),
11 +
    # Description of auto cog group
12 +
    description = character(0),
13 +
    # function to calculate the auto cogs
14 +
    fn = list()
15 +
  )
3 16
4 -
known_cog_groups_ <- tibble::tibble(
5 -
  # Name of autocog
6 -
  name = character(0),
7 -
  # Fields required
8 -
  fields = list(),
9 -
  # Description of auto cog group
10 -
  description = character(0),
11 -
  # function to calculate the auto cogs
12 -
  fn = list()
13 -
)
17 +
  known_cog_groups <- function() {
18 +
    known_cog_groups_
19 +
  }
20 +
  known_cog_groups_name <- function() {
21 +
    known_cog_groups_$name
22 +
  }
23 +
  known_cog_groups_add <- function(new_cog_group) {
24 +
    known_cog_groups_ <<- bind_rows(
25 +
      known_cog_groups_,
26 +
      new_cog_group
27 +
    )
28 +
    invisible(known_cog_groups())
29 +
  }
30 +
31 +
  return(list(
32 +
    known_cog_groups = known_cog_groups,
33 +
    known_cog_groups_name = known_cog_groups_name,
34 +
    known_cog_groups_add = known_cog_groups_add
35 +
  ))
36 +
})
37 +
known_cog_groups_fn <- known_cog_info$known_cog_groups
38 +
known_cog_groups_name <- known_cog_info$known_cog_groups_name
39 +
known_cog_groups_add <- known_cog_info$known_cog_groups_add
14 40
15 41
#' Cognostic Group information
16 42
#'
@@ -20,8 +46,5 @@
Loading
20 46
#' @examples
21 47
#' known_cog_groups()
22 48
known_cog_groups <- function() {
23 -
  known_cog_groups_
24 -
}
25 -
known_cog_groups_name <- function() {
26 -
  known_cog_groups_$name
49 +
  known_cog_groups_fn()
27 50
}

@@ -34,7 +34,7 @@
Loading
34 34
    fn = list(fn)
35 35
  )
36 36
37 -
  known_cog_groups_ <<- bind_rows(known_cog_groups_, cog_group)
37 +
  known_cog_groups_add(cog_group)
38 38
39 39
  assign(
40 40
    paste("autocog_", name, sep = ""),
Files Coverage
R 55.04%
Project Totals (14 files) 55.04%
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