ngstk (version 0.1.1.1)

split_row_file: Function to split big file to a series small files (by row)

Description

Function to split big file to a series small files (by row)

Usage

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))

Arguments

filename

Filename that need to be split

each_file_lines

Each file row num

use_system_split

Wheather use system split commend

system_split_params

When use_system_split, provide the prefix and other params default is 'split'

write_fun

Function to read data, default is read.table

write_params_x

Parameter name of output object in read.fun

write_params_file

Parameter name of input file in read.fun

write_params

Other parameters pass to write_fun

Examples

Run this code
# 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