dir2dfList: Turn a directory of flat files into a list of data.frames

Description Usage Arguments Value See Also Examples

Description

Useful to prepare data for tableNet

Usage

1
dir2dfList(dfdir, ext = ".txt", exclude = NULL, ...)

Arguments

dfdir

character string of the directory where you want to load flat files

ext

file extention on the type of files to load. Usually .csv or .txt

exclude

character string of table names to be excluded from app. Needs to be specified to NULL or a character vector or else ... arguments will not be handled properly.

...

parameters to pass to read.delim. Commonly nrow, sep,

Value

list of data.frames

See Also

tableNet isKey

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
## download some baseball data. NOTE This will download 30MB of data (25 csv files) into a temporary directory
temp <- tempfile()
localDataDir <- paste0(tempdir(), '\\lahman2012-csv-onYourComp.zip')
download.file('http://seanlahman.com/files/database/lahman2012-csv.zip', localDataDir)
unzip(localDataDir, exdir=paste0(tempdir(), '\\lahman2012-csv-onYourComp')) ## may not be necessary

## create a list of data.frames from .CSVs
dfL <- dir2dfList(paste0(tempdir(), '\\lahman2012-csv-onYourComp'), ext='.csv', exclude=NULL, sep=',', stringsAsFactors=F)

## End(Not run)

brooksandrew/Rsenal documentation built on May 13, 2019, 7:50 a.m.