Learn R Programming

spatgeom (version 0.3.0)

donut_data: Donut example

Description

Generate data points with the shape of a donut.

Usage

donut_data(n, a, b, theta)

Value

A data frame with three variables. Variable 'y' is the response, variable 'x1' makes the donut shape with 'y', and 'x2' is a uniform random variable between a and b. '

Arguments

n

Number of data points.

a

Lower bound of the second variable.

b

Upper bound of the second variable.

theta

Angle of the donut.

Examples

Run this code
xy <- donut_data(n = 30, a = -1, b = 1, theta = 2 * pi)

Run the code above in your browser using DataLab