make_test_dat {healthdb}R Documentation

Make test data

Description

Make a toy data set for testing and demo. This is for internal use purpose and not intended to be called by users.

Usage

make_test_dat(
  vals_kept = c("304", "305", 3040:3049, 3050:3059),
  noise_val = "999",
  IDs = 1:50,
  date_range = seq(as.Date("2015-01-01"), as.Date("2020-12-31"), by = 1),
  nrows = 100,
  n_any = 50,
  n_all = 10,
  seed = NULL,
  answer_id = NULL,
  type = c("data.frame", "database")
)

Arguments

vals_kept

A vector of values that suppose to be identified.

noise_val

A vector of values that are not meant to be identified.

IDs

A vector of client IDs.

date_range

A vector of all possible dates in the data.

nrows

Number of rows of the output.

n_any

Number of rows to be identified if the criteria is that if any target column contains certain values.

n_all

Number of rows to be identified if the criteria is that if all target columns contain certain values.

seed

Seed for random number generation.

answer_id

Column name for the indicator of how the row should be identified: any, all, and noise.

type

Output type, "data.frame" or "database".

Value

A data.frame or remote table from 'dbplyr'.

Examples

make_test_dat() %>% head()

[Package healthdb version 0.3.1 Index]