read_db: Function to get data from a sql database

View source: R/read_db.R

read_dbR Documentation

Function to get data from a sql database

Description

get data from a sql database. A specific time period can be selected

Usage

read_db(
  db.name = "dynament.db",
  table.name = "dynament_test",
  datelim = NULL,
  cols = "*",
  sqlpath = sqlpfad,
  korrektur_dyn = T,
  metapath = metapfad_dyn
)

Arguments

db.name

name of the database for "dynament.db" either "dynament_test" or "samplerx" for "GGA.db" either "gga" or "micro"

table.name

name of the table in the database

datelim

limits of the time period that is loaded as character or POSIXct if all Data should be loaded datelim = NULL

cols

names of the colums that will be loaded. default is all colums: cols = "*"

sqlpath

path to the database

korrektur_dyn

logical specifies whether dynament values are corrected for the specific sansor id or not if db.name is "dynament.db"

metapath

path to the "korrektur_fm.RData" file for correction factors

Value

data.frame

Examples

#Zeitrahmen festlegen
datelim<-c("2020-01-15 10:00:00","2020-01-21 10:00:00")

#read_db anwenden
dynament_raw<-read_db("dynament.db","dynament_test",datelim,korrektur_dyn=F)
GGA<-read_db("GGA.db","micro",datelim,"CO2,CO2dry")

laurin-f/pkg.WWM documentation built on July 19, 2023, 12:04 a.m.