rep_dataframe: Repeat dataframe Repeats rows in dataframe n times (where n...

Description Usage Arguments Value Examples

View source: R/helpers.R

Description

Repeat dataframe Repeats rows in dataframe n times (where n is specified in a vector with equal entries). Used to lengthen out odds ratio from original responses to match with or dataframe from post for faster substraction. from Peter Solymos (mefa-package: https://www.rdocumentation.org/packages/mefa/versions/3.2-7/topics/rep.data.frame)

Usage

1

Arguments

x

a matrix or data frame, but can be a vector.

...

arguments passed to the function rep, i.e. times, length.out and each (see explanation there).

Value

tibble

Examples

1
2
3
4
5
6
  t <- tibble::tribble(
  ~x, ~y, ~z,
  1, 1, 1,
  0, 0, 1,
  )
  result <- t %>% rep_dataframe(20)

Famondir/birtms documentation built on Feb. 18, 2022, 2:51 a.m.