dbReadTable-SQLiteConnection-character-method: Read a database table

Description Usage Arguments Details Value See Also Examples

Description

Returns the contents of a database table given by name as a data frame.

Usage

1
2
3
4
## S4 method for signature 'SQLiteConnection,character'
dbReadTable(conn, name, ...,
  row.names = pkgconfig::get_config("RSQLite::row.names.table", FALSE),
  check.names = TRUE, select.cols = NULL)

Arguments

conn

a SQLiteConnection object, produced by DBI::dbConnect()

name

a character string specifying a table name. SQLite table names are not case sensitive, e.g., table names ABC and abc are considered equal.

...

Needed for compatibility with generic. Otherwise ignored.

row.names

Either TRUE, FALSE, NA or a string.

If TRUE, always translate row names to a column called "row_names". If FALSE, never translate row names. If NA, translate rownames only if they're a character vector.

A string is equivalent to TRUE, but allows you to override the default name.

For backward compatibility, NULL is equivalent to FALSE.

check.names

If TRUE, the default, column names will be converted to valid R identifiers.

select.cols

Deprecated, do not use.

Details

Note that the data frame returned by dbReadTable() only has primitive data, e.g., it does not coerce character data to factors.

Value

A data frame.

See Also

The corresponding generic function DBI::dbReadTable().

Examples

1
2
3
4
5
library(DBI)
db <- RSQLite::datasetsDb()
dbReadTable(db, "mtcars")
dbReadTable(db, "mtcars", row.names = FALSE)
dbDisconnect(db)

r-dbi/RSQLite documentation built on Oct. 21, 2018, 3:14 p.m.