Skip to contents

Creates a visualization of time series data. Useful for analyzing patterns in continuous measurements such as physiological data or other single-trace recordings.

Usage

plot_timeseries(data, value_col, time_col = "time", y_max = NULL)

Arguments

data

A data frame containing time series data with the following columns:

  • Time column (specified by time_col, defaults to "time")

  • Column specified by value_col containing the values to plot

value_col

Character string specifying which column to plot

time_col

Character string specifying the time column (default: "time")

y_max

Optional numeric value specifying the maximum value for the y-axis. If NULL (default), the y-axis limit is automatically determined from the data.

Value

A ggplot object wrapped in patchwork.

Examples

if (FALSE) { # \dontrun{
# Plot heart rate data
plot_timeseries(physio_data, value_col = "heart_rate")

# Plot temperature with custom time column
plot_timeseries(physio_data,
               value_col = "temperature",
               time_col = "timestamp")
} # }