Description Usage Arguments Details Value Examples

Add single row to definitions table

1 2 |

`dtDefs` |
Definition data.table to be modified |

`varname` |
Name (string) of new variable |

`formula` |
An R expression for mean (string) |

`variance` |
Number |

`dist` |
Distribution. For possibilities, see details |

`link` |
The link function for the mean, see details |

`id` |
A string indicating the field name for the unique record identifier |

The possible data distributions include "normal", "poisson", "noZeroPoisson", "negBinomial" "binary", "binomial", "beta", "uniform", "uniformInt", "categorical", "gamma", "exponential", and "nonrandom."

A data.table named dtName that is an updated data definitions table

1 2 3 4 5 6 7 8 | ```
def <- defData(varname = "xNr", dist = "nonrandom", formula=7, id = "idnum")
def <- defData(def, varname="xUni", dist="uniform", formula="10;20")
def <- defData(def, varname="xNorm", formula="xNr + xUni * 2", dist="normal", variance=8)
def <- defData(def, varname="xPois", dist="poisson", formula="xNr - 0.2 * xUni", link="log")
def <- defData(def, varname="xCat", formula = "0.3;0.2;0.5", dist="categorical")
def <- defData(def, varname="xGamma", dist="gamma", formula = "5+xCat", variance = 1, link = "log")
def <- defData(def, varname = "xBin", dist = "binary" , formula="-3 + xCat", link="logit")
def
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.