get_data_custom: get_data_custom

View source: R/get_data_custom.r

get_data_customR Documentation

get_data_custom

Description

This function allows users to extract other tables within a known database that the script does not get by default. They must have access to the tables to extract them.

Usage

get_data_custom(
  schema = NULL,
  data.dir = file.path(getwd(), "data"),
  tables = NULL,
  cxn = NULL,
  usepkg = "rodbc",
  fn.oracle.username = "_none_",
  fn.oracle.password = "_none_",
  fn.oracle.dsn = "_none_",
  env = .GlobalEnv,
  quiet = F
)

Arguments

schema

default is NULL. This is the schema you want to access a additional tables from.

data.dir

The default is your working directory. If you are hoping to load existing data, this folder should contain a data folder containing your rdata files. If you are extracting data, a data folder will be created under this folder. extracted files to go.

tables

The default value is NULL. This is a vector of table names you want to extract that exist in the database specified by db.

cxn

A valid Oracle connection object. This parameter allows you to pass an existing connection, reducing the need to establish a new connection within the function. If provided, it takes precedence over the connection- related parameters.

usepkg

default is oracle_cxn$usepkg. This indicates whether the connection to Oracle should use 'rodbc' or 'roracle' to connect. rodbc is slightly easier to setup, but roracle will extract data ~ 5x faster. Deprecated; use cxn instead.

fn.oracle.username

Default is '_none_'. This is your username for accessing Oracle objects. If you have a value for oracle.username stored in your environment (e.g., from an rprofile file), this can be left out and that value will be used. If a value for this is provided, it will take priority over your existing value. Deprecated; use cxn instead.

fn.oracle.password

Default is '_none_'. This is your password for accessing Oracle objects. If you have a value for oracle.password stored in your environment (e.g., from an rprofile file), this can be left out and that value will be used. If a value for this is provided, it will take priority over your existing value. Deprecated; use cxn instead.

fn.oracle.dsn

Default is '_none_'. This is your DSN/ODBC identifier for accessing Oracle objects. If you have a value for oracle.dsn stored in your environment (e.g., from an rprofile file), this can be left out and that value will be used. If a value for this is provided, it will take priority over your existing value. Deprecated; use cxn instead.

env

This the the environment you want this function to work in. The default value is .GlobalEnv.

quiet

default is FALSE. If TRUE, no output messages will be shown.

Author(s)

Mike McMahon, Mike.McMahon@dfo-mpo.gc.ca

See Also

Other dfo_extractions: get_data(), get_survey(), self_filter(), summarize_catches()


Maritimes/Mar.datawrangling documentation built on April 5, 2025, 1:47 p.m.