Learn R Programming

spatgeom (version 0.3.0)

linear_data: Linear example

Description

Generate data points with a linear relationship.

Usage

linear_data(n = 100, a = -3, b = 3)

Value

A data frame with three variables. Variable 'y = 0.6 * x1 + 0.3 * x2

  • 0.1 * x3' is the response, and 'x1', 'x2' and 'x3' are uniform random variables between a and b.

Arguments

n

Number of data points.

a, b

Lower and upper bound of the uniform distribution.

Examples

Run this code
xy <- linear_data(n = 30, a = -1, b = 1)

Run the code above in your browser using DataLab