readHRJAccessDatabase: (HRJ) Read in data from the HRJ (MS Access) data base.

Description Usage Arguments Value Examples

Description

This function relies on the RODBC package for reading MS Access data bases. Due to intermittent, non-transparent changes by Microsoft, the RODBC package has broken in the past. Additionally, 32 bit Access files require the use of 32bit R. Based on these extra steps, it is recommended that the output from this function (a list) be saved to a .Rdata file for future use. Specifically, the example demonstrates the use of readHRJAccessDatabase in conjunction with reshapeHRJtolong for flexible data manipulation.

Usage

1

Arguments

filename

A string of length one. The MS Access database name. Can be *.mdb or *.accdb file.

Value

A list comprising two elements. Each list element is a data frame, one is the 'C' table and one is the 'B' table. Their formats match that found in the mdb file.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
# reading 32 bit mdb files requires using 32bit R
hrj.list.wide <- readHRJAccessDatabase("HRJ_database 2016b.mdb")
hrj.list.long <- reshapeHRJtolong(hrj.list.wide, data.stock)
data.hrj <- list(hrj.list.wide=hrj.list.wide, hrj.list.long=hrj.list.long)
filename <- "hrj_from_mdb.RData"
save(data.hrj, file = filename)
load(filename)

## End(Not run)

MichaelFolkes/ctctools documentation built on May 7, 2019, 4:56 p.m.