R - Data Generator

> Procedural Languages > R

1 - Time Series

1.1 - Elipse

## It's deterministic and autocorrelated
t <- seq(0,0.99,by=0.01)
x <- sin(2*pi*t)
y <- sin(4*pi*t) + x
data <- data.frame(x, y)
plot(data)

Advertising

2 - Function

dfx <- data.frame(
  group = c(rep('A', 8), rep('B', 15), rep('C', 6)),
  sex = sample(c("M", "F"), size = 29, replace = TRUE),
  age = runif(n = 29, min = 18, max = 54)
)

where:

See also: R - Colon (:) Operator - Sequence generator

lang/r/generator.txt · Last modified: 2017/02/12 21:02 by gerardnico