name2code: Translate name into code

Description Usage Arguments Value Functions See Also

Description

Generic function to translate name into code

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
name2code(x, name, exact_match = TRUE, ...)

## S4 method for signature 'code_name_list'
name2code(x, name, exact_match = TRUE, ...)

## S4 method for signature 'gta_db'
name2code(
  x,
  name,
  exact_match = TRUE,
  type = c("stock", "field", "industry", "factor", "indicator"),
  ...
)

Arguments

x

A object containing code/name information.

name

A name or a vector of names to be translated. if exact_match is FALSE, name could be regular expression for non-exact matching.

exact_match

A logic to determine use exact matching or not. Default TRUE means to use exact matching

...

Extra arguments to be passed to methods.

type

A character of conversion type, e.g, "stock", "field", "industry". Default "stock" means to covert stock name to stock code.

Value

1
 A code or a vector of codes.

Functions

See Also

Other stock_db generics: close_stock_db(), code2name(), dir_path_db(), get_factors_info(), get_factors(), get_financial_report(), get_indicators_from_source(), get_indicators_info(), get_indicators(), get_industry_info(), get_market_return(), get_profile(), get_riskfree_rate(), get_spt_stocks(), get_stock_dataset(), get_stock_industry(), get_stock_info(), get_stock_return(), get_table_dataset(), init_stock_db(), list_stock_tables(), open_stock_db(), save_indicators_to_source()


chriszheng2016/zstmodelr documentation built on June 13, 2021, 8:59 p.m.