bq_field: BiqQuery field (and fields) class

Description Usage Arguments Examples

View source: R/bq-field.R

Description

bq_field() andbq_fields()create;as_bq_field()andas_bq_fields()' coerce from lists.

Usage

1
2
3
4
5
6
7
bq_field(name, type, mode = "NULLABLE", fields = list())

bq_fields(x)

as_bq_field(x)

as_bq_fields(x)

Arguments

name

Field name

type

Field type

mode

Field mode

fields

For a field of type "record", a list of sub-fields.

x

A list of bg_fields

Examples

1
2
3
4
5
6
7
8
9
bq_field("name", "string")

as_bq_fields(list(
  list(name = "name", type = "string"),
  bq_field("age", "integer")
))

# as_bq_fields() can also take a data frame
as_bq_fields(mtcars)

Example output

<bq_field> name <STRING>

<bq_fields>
  name <STRING>
  age <INTEGER>

<bq_fields>
  mpg <FLOAT>
  cyl <FLOAT>
  disp <FLOAT>
  hp <FLOAT>
  drat <FLOAT>
  wt <FLOAT>
  qsec <FLOAT>
  vs <FLOAT>
  am <FLOAT>
  gear <FLOAT>
  carb <FLOAT>

bigrquery documentation built on April 25, 2018, 1:04 a.m.