View source: R/main-datautil.R
new_x | R Documentation |
Replaces a continuous variable x
in the data frame, and
possibly another continuous variable x_ns
derived from it, with new
values, for each level of a grouping factor (usually id)
new_x(data, x_values, group_by = "id", x = "age", x_ns = NULL)
data |
A data frame. Can also be an lgpfit or lgpmodel object, in which case data is extracted from it. |
x_values |
the values of |
group_by |
name of the grouping variable, must be a factor
in |
x |
of the variable along which to extend,
must be a numeric in |
x_ns |
of a nonstationary variable derived from |
a data frame containing the following columns
all factors in the original data
x
x_ns
(unless it is NULL)
Other data frame handling functions:
add_dis_age()
,
add_factor()
,
add_factor_crossing()
,
adjusted_c_hat()
,
split()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.