[datatable-help] does fread read gz files yet ?

statquant3 statquant at outlook.com
Fri Apr 17 17:31:38 CEST 2015


doing fread('zcat filePath.gz') still works

loadTableFromCsvFile <- function(csvFileName, verbose=FALSE, ...){
	#add zcat if the file extention is gz
	input <- paste0(ifelse(str_sub(csvFileName,-2)=='gz','zcat
',''),csvFileName) 
	#read the file
	dt <- fread(input,...)
	if(verbose) cat('Loaded',csvFileName,'\n')
	return(dt)
}




--
View this message in context: http://r.789695.n4.nabble.com/does-fread-read-gz-files-yet-tp4705980p4705992.html
Sent from the datatable-help mailing list archive at Nabble.com.


More information about the datatable-help mailing list