Learn R Programming

replyr (version 0.9.2)

addConstantColumn: Add constant to a table.

Description

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

Usage

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

Run this code
# NOT RUN {
d <- data.frame(x= c(1:3))
addConstantColumn(d, 'newCol', 'newVal')

# }

Run the code above in your browser using DataLab