do_segments_by_column: Divide a data frame into n column-wise segments

View source: R/do_segments_by_column.R

do_segments_by_columnR Documentation

Divide a data frame into n column-wise segments

Description

The last segment will contain remaining columns if n is not a divisor of the number of data frame columns.

Usage

do_segments_by_column(fr, write = FALSE, n = 4, fn = "data/Mark.UBS4")

Arguments

fr

A data frame

write

logical flag: (default = FALSE) if TRUE then write output files

n

Number of segments (must be less than or equal to 26)

fn

Output file stem

Details

File paths are relative to the current working directory (gettable with getwd() and settable with setwd()). Segments are written as CSV files with names derived from the output file stem. E.g. if n is 4 and the stem is "data/Mark.UBS4" then the output files will be written to:

  • "data/Mark.UBS4.a.csv"

  • "data/Mark.UBS4.b.csv",

  • "data/Mark.UBS4.c.csv"

  • "data/Mark.UBS4.d.csv"

Value

Nothing. Output files are produced as a side effect.


tjfinney/ANTTV documentation built on July 1, 2024, 11 p.m.