Skip to contents

Writes a schedule as JSON in the exact {"1": 0, "2": 1, ...} format consumed by the companion iOS Shortcuts EMA logger (https://github.com/haomeng797-ship-it/melatonin-ema-logger), so a generated design can be dropped straight into an existing collection pipeline.

Usage

write_schedule(schedule, path)

Arguments

schedule

A nof1_schedule from design_schedule().

path

File path for the JSON output, e.g. "schedule.json".

Value

The path, invisibly.

Examples

sched <- design_schedule(n_days = 70, seed = 20260218)
tmp <- tempfile(fileext = ".json")
write_schedule(sched, tmp)