Check if a table exists in the database

sqliteTableExists(table, file)

Arguments

table

Name of the table to check for existence

file

Database to query

Value

A logical value that indicates whether the table exists in the database.

Examples

# Example data ---- library(RSQLite) database_file <- tempfile() conn <- dbConnect(SQLite(), dbname = database_file) dbWriteTable(conn, "mtcars", mtcars[1:5, ]) dbWriteTable(conn, "USArrests", USArrests[1:5, ]) dbDisconnect(conn) # Example ---- sqliteTableExists("status_summary", database_file)
#> [1] FALSE