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

Description Usage Arguments Value Examples

View source: R/data_process_tools.R

Description

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

Usage

1
2
3
4
5
6
7
8
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

1
2
3
4
5
6
7
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)

creditmodel documentation built on Jan. 7, 2022, 5:06 p.m.