replace_value: Replace Value

Description Usage Arguments

View source: R/data_transformation.R

Description

replace_value is for replacing values of some variables . replace_value_x is for replacing values of a variable.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
replace_value(
  dat = dat,
  x_list = NULL,
  x_pattern = NULL,
  replace_dat,
  MARGIN = 2,
  VALUE = if (MARGIN == 2) colnames(replace_dat) else rownames(replace_dat),
  RE_NAME = TRUE,
  parallel = FALSE
)

replace_value_x(
  dat,
  x,
  replace_dat,
  MARGIN = 2,
  VALUE = if (MARGIN == 2) colnames(replace_dat) else rownames(replace_dat),
  RE_NAME = TRUE
)

Arguments

dat

A data.frame.

x_list

Names of variables to replace value.

x_pattern

Regular expressions, used to match variable names.

replace_dat

A data.frame contains value to replace.

MARGIN

A vector giving the subscripts which the function will be applied over. E.g., for a matrix 1 indicates rows, 2 indicates columns, c(1, 2) indicates rows and columns. Where X has named dimnames, it can be a character vector selecting dimension names.

VALUE

Values to replace.

RE_NAME

Logical, rename the replaced variable.

parallel

Logical, parallel computing. Default is TRUE.

x

Name of variable to replace value.


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