unload_extra_library: Unload additional packages from search path.

Description Usage Arguments Details Examples

Description

Some packages would load with itself some other package depedency into the search path. In order to eliminate the possibility of conflict and avoid side effect in writing functions, it is recommended to remove additional packages from the search path after the calculation.

Usage

1
unload_extra_library(init_state = init_state)

Arguments

init_state

A list of character vectors containing the information of previous state of search path.

Details

This is also a dirty trick to remove extra packages from search path when you are writing a package and some functions from other packages you use have implicit or ill-documented depedencies so that you have to use require or library somewhere in your code.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
init_state=search()
testing_packs=function(data){
  library(caret)
  library(doParallel)
  library(foreach)
  library(magrittr)
  library(smotefamily)
  library(FNN)
  library(dbscan)
  library(ROSE)
  library(DMwR)
  library(h2o)
  library(dplyr)
  library(glue)
  library(MLmetrics)
  library(testthat)
  return(1)
}
testing_packs(data=iris)
unload_extra_library(init_state=init_state)

edwardcooper/automl documentation built on June 3, 2019, 1:05 a.m.