library(data.table)
N <- 100
DT <- data.table(
id = sample(c("id1","id2","id3"), N, TRUE),
v1 = sample(c(1:5), N, TRUE),
v2 = rnorm(N, sd = 20),
v3 = sample(runif(100, max=100), N, TRUE)
)
DT[, v4 := v3 + rnorm(N, sd = 20)]
graph(DT, by = id)
graph(DT, by = id, facet = TRUE)
graph(DT, by = id, type = "boxplot")
graph(DT, v3, v4, along_with = v2, by = id, type = "loess")
Run the code above in your browser using DataLab