powered by
Function to split big file to a series small files (by row)
split_row_file(filename, each_file_lines = 100, use_system_split = FALSE, system_split_params = "_split", write_fun = "write.table", write_params_x = "x", write_params_file = "file", write_params = list(sep = "", row.names = FALSE, col.names = FALSE, quote = FALSE))
Filename that need to be split
Each file row num
Wheather use system split commend
When use_system_split, provide the prefix and other params default is 'split'
Function to read data, default is read.table
Parameter name of output object in read.fun
Parameter name of input file in read.fun
Other parameters pass to write_fun
# NOT RUN { dat <- data.frame(col1 = 1:1000) outfn <- tempfile() write.table(dat, outfn, sep = '\t', quote = FALSE, row.names = FALSE) split_row_file(outfn) # }
Run the code above in your browser using DataLab