View source: R/create_courses.R
create_courses | R Documentation |
Create courses of therapy in CCMH data.
create_courses(data, firstOnly = FALSE, daysbetween = 90)
data |
CCMH data files with UniqueClientID and Date variables |
firstOnly |
If FALSE, will return the whole data set. If TRUE, will return only each client's first course. |
daysbetween |
The number of days between records that triggers an additional course. By default, 90. |
A data frame with added variables indicating courses.
If firstOnly
= FALSE
, all courses are retained, with the following variables added:
UniqueClientID_byCourse
: an ID unique to each course of therapy. This is created by adding .1 to UniqueClientID for their first course (e.g. 100.1), .2 for their second course (100.2), etc.
RankCourse
: The course number that the line of data belongs to, numbered 1 through N of courses.
FirstCourse
: A dichotomous variable indicating whether the lines of data belong to a client's first course or not.
If firstOnly
= TRUE
, only the first course is selected, and no variables are added.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.