create_flat_files: Get data from 'oliver_replica' and write to multiple files

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Using a connection to oliver_replica, materialize flat files for use in various reports. For now, the files are written in a feather format in the Data directory of the package. This function is a wrapper for write_oliver_data.

Usage

1
2
3
4
create_flat_files(con, tables = c("report_businessmetrics_memberbreakdown",
  "report_businessmetrics_provideractivity", "report_businessmetrics_rollup",
  "report_pcvmetrics_servicereferrals", "report_pcvmetrics_visitreports",
  "Organizations"), schemas = c(rep("static", 5), "staging"))

Arguments

con

An object of class src_postgres which specifies a connection to the oliver replica.

tables

A vector of table or view names that will be queried from the oliver replica and written to feather files in the Data directory. Defaults to c('report_businessmetrics_memberbreakdown', 'report_businessmetrics_provideractivity', 'report_businessmetrics_rollup', 'report_pcvmetrics_servicereferrals', 'report_pcvmetrics_visitreports').

schemas

A vector of schema names associated with the table parameter. Defaults to c(rep('static', 5), 'staging').

Details

The following dependencies are required in order to create a valid string as shown in the example below:

Value

n feather files to the Data directory of the package, where n is equal to length(tables).

Author(s)

Joe Mienko, mienkoja@uw.edu

See Also

load_flat_files, write_oliver_data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(dplyr)
library(RPostgreSQL)
library(feather)

con <- src_postgres(
  dbname = 'oliver_replica',
  host = '127.0.0.1',
  user = 'mienkoja',
  password = 'mypassword'
)

create_flat_files(con = con)

pocdata/oliveR documentation built on May 25, 2019, 10:23 a.m.