dbSingleDF: Extract a single data table from a relational data base.

Description Usage Arguments Details Value Examples

View source: R/03_DB_infos.R

Description

Function to extract a single, complete data table from a relational data base. Especially useful for the extraction of the meta information stored in Meta_Data.

Usage

1
dbSingleDF(dfName = "Meta_Data", filePath)

Arguments

dfName

Name of the data table which should be extracted.

filePath

Path of the existing db file.

Details

This function makes use of the DBI::dbReadTable function and extracts a complete data table from a data base. All variables are extracted and all rows are used. For extracting only some variables or merging data tables see dbPull.

Value

Returns a data frame with all variables and cases as in the corresponding data table.

Examples

1
2
3
4
5
6
7
8
9
db_path <- system.file("extdata", "example_dataBase.db", package = "eatDB")

## Extract all meta information
meta_data <- dbSingleDF(dfName = "Meta_Data", filePath = db_path)
meta_data

## Extract a specific data table
NoImp <- dbSingleDF(dfName = "NoImp", filePath = db_path)
NoImp

eatDB documentation built on Oct. 5, 2021, 5:06 p.m.