plot_trajectory: Plot Hyfe trajectory

Description Usage Arguments

View source: R/plot_trajectory.R

Description

In this plot, all users are plotted with the start of their monitoring period beginning at the plot's origin. This type of plot could be useful if you want to examine patterns across users, such as retention in using the app or the evoution of cough during a COVID-19 diagnosis.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
plot_trajectory(
  ho,
  type = c("coughs", "sounds", "sessions", "rate"),
  unit = c("days", "hours", "weeks"),
  pool_users = FALSE,
  day_max = NULL,
  print_plot = TRUE,
  return_plot = FALSE,
  return_data = FALSE,
  verbose = TRUE
)

Arguments

ho

A hyfe object, which is generated by process_hyfe_data(). This function only accepts hyfe objects that have been processed with by_user = TRUE. See full details and examples in the package vignette.

type

The variable to plot.

pool_users

If TRUE, all user data will be pooled together into a single cumulative line.

day_max

Option to control the extent of the X axis. In a trajectory plot, the minimum of the X axis will always be zero.

print_plot

If TRUE (the default), the plot will be printed for you.

return_plot

If TRUE (not the default), the ggplot plot object will be returned. This can be useful if you want to modify/add to the plot (e.g., change axis titles, add a plot title, etc.).

return_data

If TRUE (not the default), a simple dataframe will be returned that provides you with the exact values used to produce the plot.

verbose

Print status updates?

time_unit

The time unit by which to plot it.


hyfe-ai/hyfer documentation built on Dec. 20, 2021, 5:53 p.m.