Skip to content

Commit 2b08362

Browse files
Shorten examples for the check
1 parent 4ff11a3 commit 2b08362

9 files changed

+22
-18
lines changed

R/explain_forest.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
#' @import DT
1616
#'
1717
#' @examples
18+
#' \dontrun{
1819
#' forest <- randomForest::randomForest(Species ~ ., data = iris, localImp = TRUE)
19-
#' explain_forest(forest, vars = names(iris))
20+
#' explain_forest(forest, interactions = TRUE)
21+
#' }
2022
#'
2123
#' @export
2224
explain_forest <- function(forest, interactions = FALSE, data = NULL, vars = NULL, no_of_pred_plots = 3, pred_grid = 100,

R/measure_importance.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ measure_importance <- function(forest, mean_sample = "top_trees", measures = NUL
166166
#' @importFrom data.table frankv
167167
#'
168168
#' @examples
169-
#' forest <- randomForest::randomForest(Species ~ ., data = iris, localImp = TRUE)
170-
#' important_variables(measure_importance(forest))
169+
#' forest <- randomForest::randomForest(Species ~ ., data = iris, localImp = TRUE, ntree = 300)
170+
#' important_variables(measure_importance(forest), k = 2)
171171
#'
172172
#' @export
173173
important_variables <- function(importance_frame, k = 15, measures = names(importance_frame)[2:5],
@@ -286,7 +286,7 @@ plot_multi_way_importance <- function(importance_frame, x_measure = "mean_min_de
286286
#'
287287
#' @examples
288288
#' forest <- randomForest::randomForest(Species ~ ., data = iris, localImp = TRUE)
289-
#' plot_importance_ggpairs(measure_importance(forest))
289+
#' plot_importance_ggpairs(measure_importance(forest), measures = c("mean_min_depth", "times_a_root"))
290290
#'
291291
#' @export
292292
plot_importance_ggpairs <- function(importance_frame, measures =
@@ -320,7 +320,7 @@ plot_importance_ggpairs <- function(importance_frame, measures =
320320
#'
321321
#' @examples
322322
#' forest <- randomForest::randomForest(Species ~ ., data = iris, localImp = TRUE)
323-
#' plot_importance_ggpairs(measure_importance(forest))
323+
#' plot_importance_ggpairs(measure_importance(forest), measures = c("mean_min_depth", "times_a_root"))
324324
#'
325325
#' @export
326326
plot_importance_rankings <- function(importance_frame, measures =

R/min_depth_interactions.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ min_depth_interactions_values <- function(forest, vars){
6464
#' @importFrom data.table rbindlist
6565
#'
6666
#' @examples
67-
#' forest <- randomForest::randomForest(Species ~ ., data = iris, ntree = 200)
68-
#' min_depth_interactions(forest, names(iris))
67+
#' forest <- randomForest::randomForest(Species ~ ., data = iris, ntree = 100)
68+
#' min_depth_interactions(forest, c("Petal.Width", "Petal.Length"))
6969
#'
7070
#' @export
7171
min_depth_interactions <- function(forest, vars = important_variables(measure_importance(forest)),
@@ -125,8 +125,8 @@ min_depth_interactions <- function(forest, vars = important_variables(measure_im
125125
#' @import ggplot2
126126
#'
127127
#' @examples
128-
#' forest <- randomForest::randomForest(Species ~ ., data = iris, ntree = 200)
129-
#' plot_min_depth_interactions(min_depth_interactions(forest, names(iris)))
128+
#' forest <- randomForest::randomForest(Species ~ ., data = iris, ntree = 100)
129+
#' plot_min_depth_interactions(min_depth_interactions(forest, c("Petal.Width", "Petal.Length")))
130130
#'
131131
#' @export
132132
plot_min_depth_interactions <- function(interactions_frame, k = 30,

man/explain_forest.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/important_variables.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/min_depth_interactions.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plot_importance_ggpairs.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plot_importance_rankings.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plot_min_depth_interactions.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)