Description Usage Arguments Details Value Functions See Also
Generic function to update tables in stock database by importing new data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | update_db(
stock_db,
data_source = get_datasource(stock_db),
retry_log = NULL,
log_file_prefix = "update_db_log",
log_dir = "./log",
...
)
## S4 method for signature 'gta_db'
update_db(
stock_db,
data_source = get_datasource(stock_db),
retry_log = NULL,
log_file_prefix = "update_db_log",
log_dir = "./log",
...
)
|
stock_db |
A stock database object to operate. |
data_source |
Data source info produced by get_datasource(stock_db) |
retry_log |
Log file for re-importing tables with recording failure in log file. If NULL, it will update all tables in data_source, otherwise only update on these tables with recording failure in log file. By default NULL. |
log_file_prefix |
A character of log file prefix to name log file. Log file is named as format of "log_file_prefix_XXXX_(current).csv" Default is "update_db_log". |
log_dir |
Path to save updating log file. NULL means to use "./" as log dir. Default "./log". |
... |
Extra arguments to be passed to methods. |
By combining information from data_source and re-try log file , it update all tables from raw data of datasource in following steps:
Build target tables info from all tables in datasource or some tables with recording failure in retry log file;
Update target tables by importing data from datasource;
Save update log, etc.
Update log is saved in log dir, like "update_log_XXXX(current).csv"
NULL invisibly. Raise error if anything goes wrong.
update_db,gta_db-method
: update tables in a database of gta_db class
Other data management:
clear_tables()
,
convert_import_file()
,
get_datasource()
,
import_table()
,
process_files()
,
read_import_file()
,
ttm_financial_report()
,
write_import_file()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.