m4_select_data: Basic SELECT statement wrapper returning results in a tibble

Description Usage Arguments Value Examples

View source: R/m4_base.R

Description

Wrapper around DBI functions to send a SELECT statement, fetch the results and return them in a tibble.

Usage

1
m4_select_data(con, select)

Arguments

con

A bigrquery::bigquery() DBIConnection object, as returned by DBI::dbConnect() with an appropriate bigrquery::bigquery() DBI driver specified in the call.

select

a character string representing a SQL SELECT statement.

Value

a tibble with the results.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# To run examples, you must have the BIGQUERY_TEST_PROJECT environment
# variable set to name of project which has billing set up and to which
# you have write access.
con <- bigrquery::dbConnect(
  bigrquery::bigquery(),
  project = bigrquery::bq_test_project(),
  quiet = TRUE
)

m4_select_data(con, "select * from physionet-data.mimic_icu.d_items order by itemid limit 5")

bigrquery::dbDisconnect(con)

hdshea/MIMIC4db documentation built on Dec. 20, 2021, 3:45 p.m.