check_names_delete: check whether list names (tobechecked) is within specified...

Description Usage Arguments Value Examples

Description

check whether list names (tobechecked) is within specified sets ('checking')

Usage

1
2
3
check_names_delete(tobechecked, checking, STOP = TRUE,
  tobechecked_name = "tobechecked", checking_name = "checking",
  default_value = NULL, PRINT = TRUE)

Arguments

tobechecked

a named list / character vector to be checked

checking

a character vector, the names in 'tobechecked' is supposed to show up here.

STOP

STOP if there are names in 'tobechecked' not showing up in 'checking'. If FALSE, then we will delete the names not showing up in 'checking'.

tobechecked_name

a character, name of 'tobechecked' for printing.

checking_name

a character, name of 'checking' for printing.

default_value

value to be returned if all names in tobechecked are not in 'checking'.

PRINT

whether print diagnostic information.

Value

a 'purified' named list / character vector , with all names not showing up in 'checking' deleted.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
tobechecked = list('cut' = 1, 'dwewsdfds' = 2); checking = 'cut'

result =   check_names_delete(tobechecked, checking, STOP = FALSE,
                              tobechecked_name = 'focus_var',
                              checking_name = 'all_raw_vars')
result

result = check_names_delete(tobechecked, checking, STOP = FALSE)
result

tobechecked = c('cut', 'dsfsf'); checking = 'cut'
result = check_names_delete(tobechecked, checking, STOP = FALSE)
result

Fan-Yang-Econ/linear.tools_github documentation built on May 6, 2019, 4:34 p.m.