loop_function {creditmodel}R Documentation

Loop Function. #' loop_function is an iterator to loop through

Description

Loop Function. #' loop_function is an iterator to loop through

Usage

loop_function(
  func = NULL,
  args = list(data = NULL),
  x_list = NULL,
  bind = "rbind",
  parallel = TRUE,
  as_list = FALSE
)

Arguments

func

A function.

args

A list of argauments required by function.

x_list

Names of objects to loop through.

bind

Complie results, "rbind" & "cbind" are available.

parallel

Logical, parallel computing.

as_list

Logical, whether outputs to be a list.

Value

A data.frame or list

Examples

dat = UCICreditCard[24:26]
num_x_list = get_names(dat = dat, types = c('numeric', 'integer', 'double'),
                      ex_cols = NULL, get_ex = FALSE)
dat[ ,num_x_list] = loop_function(func = outliers_kmeans_lof, x_list = num_x_list,
                                   args = list(dat = dat),
                                   bind = "cbind", as_list = FALSE,
                                 parallel = FALSE)

[Package creditmodel version 1.3.1 Index]