tx_ml | R Documentation |
tx_ml
Generates clients who have become inactive over a specified
period of time. The default is to generate all clients who became inactive
in the current Fiscal Year. You can specify the period of interest
(using the from
and to
arguments). Used together
with tx_ml_outcomes()
, generates inactive clients with a particular
outcome of interest.
tx_ml( new_data, old_data = NULL, from = NULL, to = NULL, states = NULL, facilities = NULL, status = "default", remove_duplicates = FALSE )
new_data |
The current datafame where changes in current treatment status will be checked. |
old_data |
The initial dataframe containing the list of clients who were previously active. |
from |
The start date in ISO8601 format (i.e. "yyyy-mm-dd"). The default is to start at the beginning of the current Fiscal Year (i.e. 1st of October). |
to |
The end date written in ISO8601 format (i.e. "yyyy-mm-dd"). The default is the date of analysis. |
states |
The name(s) of the State(s) of interest. The default utilizes all
the states in the dataframe. If specifying more than one state, combine the
states using the |
facilities |
The name(s) of the facilit(ies) of interest. Default is to utilize
all the facilities contained in the dataframe. If specifying more than one
facility, combine the facilities using the |
status |
Determines how the number of active clients is calculated. The options are to either to use the NDR current_status_28_days column or the derived current_status column ("calculated"). |
remove_duplicates |
Boolean argument. It specifies if duplicate patient entries in the facilities should be removed or kept |
tx_ml
tx_ml(new_data = ndr_example, from = "2021-06-01") # Find clients who were inactive in Q4 of FY21 tx_ml( new_data = ndr_example, from = "2021-07-01", to = "2021-09-30" ) ## generate line-list of `tx_ml()` using two datasets file_path <- "https://raw.githubusercontent.com/stephenbalogun/example_files/main/ndr_example.csv" ndr_old <- read_ndr(file_path, time_stamp = "2021-02-15") ndr_new <- ndr_example tx_ml( old_data = ndr_old, new_data = ndr_new, from = "2021-07-01", to = "2021-09-30" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.