commit: Commit contents of workbook

Description Usage Arguments Value

View source: R/embsecbio.R

Description

Commit contents of workbook to database, conn.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
commit(
  conn,
  workbook,
  wdir = NA,
  quiet = TRUE,
  coerce = FALSE,
  default = -999999,
  allow_duplicates = FALSE,
  ...
)

Arguments

conn

DB connection object.

workbook

Workbook filename.

wdir

Path to the workbook.

quiet

Boolean flag to hide status messages.

coerce

Boolean flag to indicate if columns should be coerced to the right type.

default

Numeric value to be used when coercing non-numeric values.

allow_duplicates

Boolean flag to indicate if duplicate records should be allowed.

...

Arguments passed on to read_workbook, readxl::read_excel

sheets

Sheet names, by default it takes the names listed in the description.

skip

Number of lines to skip.

range

A cell range to read from, as described in cell-specification. Includes typical Excel ranges like "B3:D87", possibly including the sheet name like "Budget!B2:G14", and more. Interpreted strictly, even if the range forces the inclusion of leading or trailing empty rows or columns. Takes precedence over skip, n_max and sheet.

col_names

TRUE to use the first row as column names, FALSE to get default names, or a character vector giving a name for each column. If user provides col_types as a vector, col_names can have one entry per column, i.e. have the same length as col_types, or one entry per unskipped column.

col_types

Either NULL to guess all from the spreadsheet or a character vector containing one entry per column from these options: "skip", "guess", "logical", "numeric", "date", "text" or "list". If exactly one col_type is specified, it will be recycled. The content of a cell in a skipped column is never read and that column will not appear in the data frame output. A list cell loads a column as a list of length 1 vectors, which are typed using the type guessing logic from col_types = NULL, but on a cell-by-cell basis.

na

Character vector of strings to interpret as missing values. By default, readxl treats blank cells as missing data.

trim_ws

Should leading and trailing whitespace be trimmed?

n_max

Maximum number of data rows to read. Trailing empty rows are automatically skipped, so this is an upper bound on the number of rows in the returned tibble. Ignored if range is given.

guess_max

Maximum number of data rows to use for guessing column types.

progress

Display a progress spinner? By default, the spinner appears only in an interactive session, outside the context of knitting a document, and when the call is likely to run for several seconds or more. See readxl_progress() for more details.

.name_repair

Handling of column names. By default, readxl ensures column names are not empty and are unique. If the tibble package version is recent enough, there is full support for .name_repair as documented in tibble::tibble(). If an older version of tibble is present, readxl falls back to name repair in the style of tibble v1.4.2.

Value

Tibble with report of inserted records.


special-uor/embsecbio documentation built on Dec. 23, 2021, 4:26 a.m.