Function for data extraction and design from a file (csv or txt) or a database.

data_extraction(
  type,
  file_path,
  database_connection = NULL,
  anchor = NULL,
  column_name = NULL,
  column_type = NULL,
  export_path_directory = NULL
)

Arguments

type

character expected. Mandatory. Type of process for data extration. You can choose between "csv_txt" or "database".

file_path

character expected. Mandatory. File path of the csv, txt or sql file.

database_connection

list expected. Mandatory for type "sql". By default NULL. Output list from the furdeb database connection functions (like access_dbconnection or postgresql_dbconnection).

anchor

list expected. Optional for type "sql". By default NULL. List of values to interpolate in a SQL string query. Each list element have to follow this format: name_anchor = values. Be aware that the values typing format influence the writing of the sql in the query. For example, an integer or numeric value doesn't have any quote, rather than a date or string value.

column_name

character expected. Optional for type csv_txt. By default NULL. Column name(s).

column_type

character expected. Optional for type csv_txt. By default NULL. Column type(s). You can use the same format that the argument "col_types" of the function read_delim.

export_path_directory

character expected. Optional. By default NULL. Directory path associated for the export (in csv).

Value

The function return a tibble.