dbReadTable,SQLiteConnection,character-method {RSQLite} | R Documentation |
Returns the contents of a database table given by name as a data frame.
## S4 method for signature 'SQLiteConnection,character' dbReadTable(conn, name, ..., row.names = NA, check.names = TRUE, select.cols = "*")
conn |
a |
name |
a character string specifying a table name. SQLite table names
are not case sensitive, e.g., table names |
... |
Needed for compatibility with generic. Otherwise ignored. |
row.names |
Either If A string is equivalent to For backward compatibility, |
check.names |
If |
select.cols |
A SQL expression (in the form of a character vector of
length 1) giving the columns to select. E.g. |
Note that the data frame returned by dbReadTable()
only has
primitive data, e.g., it does not coerce character data to factors.
A data frame.
The corresponding generic function DBI::dbReadTable()
.
library(DBI) db <- RSQLite::datasetsDb() dbReadTable(db, "mtcars") dbReadTable(db, "mtcars", row.names = FALSE) dbReadTable(db, "mtcars", select.cols = "cyl, gear") dbReadTable(db, "mtcars", select.cols = "row_names, cyl, gear") dbDisconnect(db)