create_df_rd: Creation of a random dataset

View source: R/create_df_rd.R

create_df_rdR Documentation

Creation of a random dataset

Description

A function to create a dataset containing :

  • a ID column containing ID from 1 to the size

  • normally distributed variables (if NULL, no column)

  • factors variables with the levels given by list input (if NULL, no column)

  • Booleans with binomial distributions with list input (if NULL, no column)

Usage

create_df_rd(
  size = 10,
  seed = NULL,
  numerics = NULL,
  booleans = NULL,
  categories = NULL
)

Arguments

size

Integer, number of profiles to create.

seed

Numeric. Seed for reproducibility. If NULL, a seed is randomly created. The default is NA

numerics

List. Normally distributed numeric columns. ID are the names and values are either NULL or a vector of length 2 with mean and std.

booleans

List. Binomial distributed columns. Keys are the names, values are either NULL or a float which is the probability of True values.

categories

List. Multinomial distributed columns. Keys are the names, values are either NULL or a vector of categorical values. The probabilities will be 1/N if a column has N unique values

Value

data.frame that can be tested by check_format_df

Examples

create_df_rd(10,NULL, list("num1" = NULL,"num2" = c(0,1)), list("bool1" = 0.5),list(a = c(1,2,3),b = c("F","M")))

bronnimannj/jbutilities documentation built on July 2, 2023, 4:09 p.m.