Description Usage Arguments Value Examples
View source: R/padis_specific_functions.R
The function follows following rule: First, it treats each id
separately. It then looks in the column days_in
for each numeric value x
that has a preceding or follwing lower or higher value y
with a difference of x - y = 1
(e.g. if there is a 4, it searches for a 3 or a 5, depending on the setting of next_day
). If it finds a preceding value y
that is one smaller than the initial value x
, it returns corresponding row-wise values from the columns variables
and stores them as in a new variable.
1 2 3 |
data |
The data frame that contains the variable |
id |
The ID variable of the participants |
days_in |
The variable identifying the day of each measurement. Must be numeric |
variables |
The variables that should be transformed to a next day variable |
prefix |
The prefix that is added to the names of the transformed variables. Default is NULL, which will set the prefix accoring to the |
next_day |
Logical. If |
Returns a data frame with the original variables as well as the transformed variables
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.