days_active_data: Count number of active days for each user

View source: R/days_active_data.R

days_active_dataR Documentation

Count number of active days for each user

Description

The number of days that each user is active

Usage

days_active_data(
  uuid_data = get_rapidpro_uuid_names(),
  flow_name,
  rapidpro_site = get_rapidpro_site(),
  token = get_rapidpro_key(),
  flatten = FALSE,
  read_runs = FALSE,
  runs_data = "result_flow_runs.RDS",
  include_archived_data = FALSE,
  get_by = "gotit",
  data_from_archived = archived_data,
  read_archived_data_from = "archived_data_monthly.RDS"
)

Arguments

uuid_data

A string containing UUID values. See set_rapidpro_uuid_names() to set this value.

flow_name

A string containing flow names to call data from.

rapidpro_site

A string containing the rapidpro website to call the data from. See set_rapidpro_site() to amend the website.

token

A string containing the token to call the data. See set_rapidpro_key() to amend the token.

flatten

Default FALSE. A boolean denoting whether the data should be flattened into a two-dimensional tabular structure.

read_runs

Default FALSE. A boolean denoting whether to read in the runs_data, or to read the data from RapidPro

runs_data

If the "runs.json" data has been read in already, this is the run data. Instead, the uuid_data, call_type, and token can be given (note that this latter approach is slower since it requires reading the data in).

include_archived_data

Default FALSE. A boolean denoting whether to include archived data or not.

get_by

A string denoting how to access the archived data (if include_archived_data is TRUE). Options are "read_from_RDS", "gotit". The first denotes that the data is read from an RDS file (given in read_archived_data_from), the latter that the data is stored and will be read in directly (see data_from_archived).

data_from_archived

If get_by = "gotit", this is the archived data.

read_archived_data_from

If get_by = "read_from_RDS", this is the archived data.

Value

A data frame with two columns: The unique ID of the individual, and the number of days they have been active.


lilyclements/Rapidreadr documentation built on April 17, 2025, 6:10 p.m.