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

Description Usage Arguments Examples

View source: R/split.R

Description

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

Usage

1
2
3
4
5
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

1
2
3
4
dat <- data.frame(col1 = 1:1000)
outfn <- tempfile()
write.table(dat, outfn, sep = '\t', quote = FALSE, row.names = FALSE)
split_row_file(outfn)

JhuangLab/ngstk documentation built on May 28, 2019, 12:43 p.m.