Description Usage Arguments Value See Also Examples
Generate columns that are related.
| 1 2 3 4 5 6 7 8 9 10 | 
| x | A starting column. | 
| j | The number of columns to produce. | 
| name | An optional prefix name to give to the columns.  If  | 
| operation | A operation character vector of length 1; either
 | 
| mean | Mean is the average value to add, subtract, multiple, or divide by. | 
| sd | The amount of variability to allow in  | 
| rep.sep | A separator to use for repeated variable names.  For example
if the  | 
| digits | The number of digits to round to.  Defaults to the max number
of significant digits in  | 
Returns a tbl_df.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | relate(1:10, 10)
(x <- r_data_frame(10, id, relate(1:10, 10, "Time", mean = 2)))
library(ggplot2)
dat <- with(x, data.frame(ID = rep(ID, ncol(x[, -1])), stack(x[, -1])))
dat[["Time"]] <- factor(sub("Time_", "", dat[["ind"]]), levels = 1:10)
ggplot(dat, aes(x = Time, y = values, color = ID, group = ID)) +
    geom_line(size=.8)
relate(1:10, 10, name = "X", operation = "-")
relate(1:10, 10, "X", mean = 1, sd = 0)
relate(1:10, 10, "Var", "*")
relate(1:10, 10, "Var", "/")
relate(gpa(30), 5, mean = .1)
relate(likert(10), 5, mean = .1, sd = .2)
relate(date_stamp(10), 6)
relate(time_stamp(10), 6)
relate(rep(100, 10), 6, "Reaction", "-")
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.