genSampleData: Generate example data

Description Usage Arguments Value Examples

View source: R/genSampleData.R

Description

Generate example data for package cdbk. The resulting data frame have variables that are numeric, character, factor, and integer with and without missing data (NAs).

Usage

1
genSampleData(n = 20, k = 5, pna = 0.1)

Arguments

n

numeric, number of rows in the resulting data frame

k

numeric, number of distinct categories in some of the variables

pna

numeric, probability of NAs in the variables

Value

Data frame with columns:

num

numeric variable

ch

character variable

fac

factor variable

int

integer variable

numna

numeric variable with missing values

chna

character variable with missing values

facna

factor variable with missing values

intna

integer variable with missing values

Examples

1
2
3
set.seed(1234)
d <- genSampleData()
str(d)

mbojan/cdbk-old documentation built on Dec. 21, 2021, 3:56 p.m.