make_static | R Documentation |
Update an existing field to include longitudinal responses.
Use data for each id
from the first available event
and
set that value for all event
rows.
make_static(
data,
id = "participant_id",
event = "session_id",
exclude = NULL,
var_in,
var_out
)
data |
Dataframe with fields specified in |
id |
character of length 1. Name of field that contains the IDs for which we need to assess the longitudinal data. |
event |
character of length 1. Name of field that contains the (longitudinal) event IDs. |
exclude |
character (vector). The value(s) to be excluded (Default: NULL; all values are used). |
var_in |
character of length 1. Name of the field that contains the longitudinal values or responses. |
var_out |
character of length 1. Name of the new field that contains
one static value per |
Dataframe with two columns: id
and var_out
data <- tibble::tribble(
~"id", ~"event", ~"values",
"A", 1, NA,
"A", 2, 2,
"A", 3, 3,
"B", 1, NA,
"B", 2, NA,
"B", 3, 1
)
make_static(
data,
var_in = "values",
var_out = "static_nothing_excluded",
id = "id",
event = "event"
)
make_static(
data,
var_in = "values",
var_out = "static_excluding_1and2",
exclude = c("1", "2"),
id = "id",
event = "event"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.