Learn R Programming

fdm2id (version 1.0.1)

data.diag: Square dataset

Description

Generate a random dataset shaped like a square divided by a custom function

Usage

data.diag(
  n = 200,
  min = 0,
  max = 1,
  f = function(x) x,
  levels = NULL,
  graph = FALSE,
  seed = NULL
)

Value

A randomly generated dataset.

Arguments

n

Number of observations in the dataset.

min

Minimum value on each variables.

max

Maximum value on each variables.

f

The function that separates the classes.

levels

Name of each class.

graph

Whether the generated dataset is plotted. FALSE by default, as everywhere else in the package: a generator has to be callable in a loop or a report without piling up graphics devices.

seed

A specified seed for random number generation.

See Also

data.parabol, data.target1, data.target2, data.twomoons, data.xor

Examples

Run this code
data.diag (graph = TRUE)

Run the code above in your browser using DataLab