updateTable: Append a newly-created table to the existing database table

Description Usage Arguments

View source: R/appendTables.R

Description

This function returns a complete version of the database table in question, as a data frame–i.e. the result contains both the rows from the new survey you are trying to add and all previous rows.

Usage

1
updateTable(tableName, tableNew, overwrite = F, cn = con, u = updateIDString)

Arguments

tableName

A character string: name of the database table. Not case sensitive. E.g. "responses" for the RESPONSES table.

tableNew

The name of a data frame object (not in quotes), corresponding to the newly-created portion of the table in question. E.g. responsesNew.

overwrite

FALSE by default. If FALSE, the function checks whether parameter ‘u' is already contained in the updateID column of the database table. If it’s not, then the function appends the data from 'tableNew'. If it is, the function does nothing and returns the table as is. If 'overwrite' == TRUE, then if 'u' is already in the database table, all data with updateID 'u' will be *removed* and replaced with the data from 'tableNew'.

cn

SQLite connection to the database.

u

the updateID you're using for this database update. When using the template script, 'u' should be updateIDString.


kaijagahm/ygdpAddSurvey documentation built on July 22, 2021, 2:11 p.m.