addConstantColumn: Add constant to a table.

Description Usage Arguments Value Examples

View source: R/addCol.R

Description

Work around different treatment of character types across remote data sources when adding a constant column to a table. Deals with issues such as Postgresql requiring a character-cast and MySQL not allowing such.

Usage

1
2
3
4
5
6
7
addConstantColumn(
  d,
  colName,
  val,
  ...,
  tempNameGenerator = mk_tmp_name_source("replyr_addConstantColumn")
)

Arguments

d

data.frame like object to add column to.

colName

character, name of column to add.

val

scalar, value to add.

...

force later arguments to be bound by name.

tempNameGenerator

temp name generator produced by wrapr::mk_tmp_name_source, used to record dplyr::compute() effects.

Value

table with new column added.

Examples

1
2
d <- data.frame(x= c(1:3))
addConstantColumn(d, 'newCol', 'newVal')

WinVector/replyr documentation built on Oct. 22, 2020, 8:07 p.m.