-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdefRepeatAdd.Rd
58 lines (50 loc) · 1.49 KB
/
defRepeatAdd.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/define_data.R
\name{defRepeatAdd}
\alias{defRepeatAdd}
\title{Add multiple (similar) rows to definitions table that will be used to add data to an
existing data.table}
\usage{
defRepeatAdd(
dtDefs = NULL,
nvars,
prefix,
formula,
variance = 0,
dist = "normal",
link = "identity",
id = "id"
)
}
\arguments{
\item{dtDefs}{Definition data.table to be modified}
\item{nvars}{Number of new variables to define}
\item{prefix}{Prefix (character) for new variables}
\item{formula}{An R expression for mean (string)}
\item{variance}{Number or formula}
\item{dist}{Distribution. For possibilities, see details}
\item{link}{The link function for the mean, see details}
\item{id}{A string indicating the field name for the unique record identifier}
}
\value{
A data.table named dtName that is an updated data definitions table
}
\description{
Add multiple (similar) rows to definitions table that will be used to add data to an
existing data.table
}
\details{
The possible data distributions are: `r paste0(.getDists(),collapse = ", ")`.
}
\examples{
def <- defRepeatAdd(nvars = 4, prefix = "g", formula = "1/3;1/3;1/3",
variance = 0, dist = "categorical")
def <- defDataAdd(def, varname = "a", formula = "1;1", dist = "trtAssign")
def <- defRepeatAdd(def, 8, "b", formula = "5 + a", variance = 3, dist = "normal")
def <- defDataAdd(def, "y", formula = "0.10", dist = "binary")
def
}
\seealso{
[distributions]
}
\concept{define_data}