Skip to content

Commit a4c0955

Browse files
committed
temp commented out until new model structures are ready
1 parent 613a91e commit a4c0955

File tree

1 file changed

+59
-59
lines changed

1 file changed

+59
-59
lines changed

R/zzz.R

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,59 @@
1-
## nocov start
2-
3-
data_obj <- ls(pattern = "_data$")
4-
data_obj <- data_obj[data_obj != "prepare_data"]
5-
6-
#' @importFrom purrr map_dfr
7-
#' @importFrom tibble as_tibble
8-
data_names <-
9-
map_dfr(
10-
data_obj,
11-
function(x) {
12-
module <- names(get(x))
13-
if (length(module) > 1) {
14-
module <- table(module)
15-
module <- as_tibble(module)
16-
module$object <- x
17-
module
18-
} else
19-
module <- NULL
20-
module
21-
}
22-
)
23-
24-
if(any(data_names$n > 1)) {
25-
print(data_names[data_names$n > 1,])
26-
stop("Some models have duplicate module names.")
27-
}
28-
rm(data_names)
29-
30-
# ------------------------------------------------------------------------------
31-
32-
engine_objects <- ls(pattern = "_engines$")
33-
engine_objects <- engine_objects[engine_objects != "possible_engines"]
34-
35-
#' @importFrom utils stack
36-
get_engine_info <- function(x) {
37-
y <- x
38-
y <- get(y)
39-
z <- stack(y)
40-
z$mode <- rownames(y)
41-
z$model <- gsub("_engines$", "", x)
42-
z$object <- x
43-
z <- z[z$values,]
44-
z <- z[z$mode != "unknown",]
45-
z$values <- NULL
46-
names(z)[1] <- "engine"
47-
z$engine <- as.character(z$engine)
48-
z
49-
}
50-
51-
engine_info <-
52-
purrr::map_df(
53-
parsnip:::engine_objects,
54-
get_engine_info
55-
)
56-
57-
rm(engine_objects)
58-
59-
## nocov end
1+
#' ## nocov start
2+
#'
3+
#' data_obj <- ls(pattern = "_data$")
4+
#' data_obj <- data_obj[data_obj != "prepare_data"]
5+
#'
6+
#' #' @importFrom purrr map_dfr
7+
#' #' @importFrom tibble as_tibble
8+
#' data_names <-
9+
#' map_dfr(
10+
#' data_obj,
11+
#' function(x) {
12+
#' module <- names(get(x))
13+
#' if (length(module) > 1) {
14+
#' module <- table(module)
15+
#' module <- as_tibble(module)
16+
#' module$object <- x
17+
#' module
18+
#' } else
19+
#' module <- NULL
20+
#' module
21+
#' }
22+
#' )
23+
#'
24+
#' if(any(data_names$n > 1)) {
25+
#' print(data_names[data_names$n > 1,])
26+
#' stop("Some models have duplicate module names.")
27+
#' }
28+
#' rm(data_names)
29+
#'
30+
#' # ------------------------------------------------------------------------------
31+
#'
32+
#' engine_objects <- ls(pattern = "_engines$")
33+
#' engine_objects <- engine_objects[engine_objects != "possible_engines"]
34+
#'
35+
#' #' @importFrom utils stack
36+
#' get_engine_info <- function(x) {
37+
#' y <- x
38+
#' y <- get(y)
39+
#' z <- stack(y)
40+
#' z$mode <- rownames(y)
41+
#' z$model <- gsub("_engines$", "", x)
42+
#' z$object <- x
43+
#' z <- z[z$values,]
44+
#' z <- z[z$mode != "unknown",]
45+
#' z$values <- NULL
46+
#' names(z)[1] <- "engine"
47+
#' z$engine <- as.character(z$engine)
48+
#' z
49+
#' }
50+
#'
51+
#' engine_info <-
52+
#' purrr::map_df(
53+
#' parsnip:::engine_objects,
54+
#' get_engine_info
55+
#' )
56+
#'
57+
#' rm(engine_objects)
58+
#'
59+
#' ## nocov end

0 commit comments

Comments
 (0)