Load: Functions to link to flat database

Description Usage Arguments Details Functions

Description

Functions to link to flat database

Usage

1
access_flat(database, table_name, data.type)

Arguments

database

Name of database. Should be either private or public for flat tables, indicating whether data is stored in public_data or research/[research folder]/private_data, or the actual name of database if extracting data from a database.

table_name

The name of dataset. File extension must be included if the data is saved as a flat file instead of in a database, e.g. 'data.csv' should be given instead of simply 'data'.

data.type

flat for flat tables and sql fo MySQL database.

Details

Request forms are read in with xlsx::read.xlsx, which reads in ICD codes as charactor. Functions to read in data should read ICD codes as character as well in optimal cases.

Cannot use data.table::fread because it does not work with R version 3.2.0.

xlsx::read.xlsx will also read ICD code as character. So if haven::read_dta and haven::read_sav reads ICD as numeric, then we cannot do anything about it. (In simulated data it is still character)

Functions


biostatUniBS/RDataXMan documentation built on Feb. 2, 2021, 9:41 a.m.