select_repeat_cols: Triple and shuffle columns in a dataframe with an even number...

View source: R/shuffle.R

select_repeat_colsR Documentation

Triple and shuffle columns in a dataframe with an even number of columns.

Description

Given a dataframe with columns ABCD, return a dataframe with columns AAACCC if offset is 1 or columns BBBDDD if offset is 2. The new columns are given names x1..xN.

Usage

select_repeat_cols(df, offset, each = 3)

Arguments

df

(dataframe) The dataframe to shuffle.

offset

(integer) Whether to grab odd (1) or even (2) columns.

each

(integer) How many times to repeat each column (default 3).

Value

Selected and tripled columns.


deepgenomics/dgshuffle documentation built on June 1, 2022, 8:18 a.m.