| select_repeat_cols | R Documentation |
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.
select_repeat_cols(df, offset, each = 3)
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). |
Selected and tripled columns.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.