Skip to contents

Load a table from a PostgreSQL database into R as a data frame.

Usage

sbfx_load_data_from_pg(
  x,
  schema = getOption("psql.schema", "public"),
  config_path = getOption("psql.config_path", NULL),
  config_value = getOption("psql.config_value", "default")
)

Arguments

x

A string of the table name.

schema

A string of the schema name. Default value is "public".

config_path

A string of a file path to the yaml configuration file. The default value grabs the file path from the psql.config_path option and uses NULL if no value supplied.

config_value

A string of the name of value. The default value grabs the value from the psql.config_value option and uses "default" if no value is supplied.

Value

A data frame.

Details

Wrapper on psql::psql_read_table().

Examples

if (FALSE) { # \dontrun{
sbfx_load_data_from_pg("capture")
sbfx_load_data_from_pg("counts", "boat_count")
} # }