---
title: "MultimodalHealthGenerator"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{MultimodalHealthGenerator}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r}
library(healthsimulation)
```

```{r, fig.width=6.5}
# Example usage and demonstration
cat("=== MULTIMODAL HEALTH TIME SERIES GENERATOR R6 CLASS ===\n\n")
cat("Creating generator instance...\n")

# Create generator with seed
generator <- MultimodalHealthGenerator$new(seed = 42)

# Generate data
health_data <- generator$generate(n_days = 100, start_date = "2024-01-01")

# Display sample
cat("\nFirst 5 rows of generated data:\n")
print(head(health_data, 5))

# Get summary statistics
cat("\nSummary statistics:\n")
summary_stats <- generator$get_summary_stats()
print(summary_stats)

# Get correlations with target
cat("\nTop correlations with wellness score:\n")
correlations <- generator$get_target_correlations()
print(head(correlations, 8))

# Analyze interdependencies
cat("\nInterdependency analysis:\n")
interdep <- generator$analyze_interdependencies()
print(interdep$stress_effects)

cat("\n=== GENERATOR FEATURES ===\n")
cat("✓ R6 class with clean OOP interface\n")
cat("✓ Seed-based reproducible generation\n")
cat("✓ Comprehensive documentation\n")
cat("✓ Built-in analysis methods\n")
cat("✓ Visualization capabilities\n")
cat("✓ Data export functionality\n")
cat("✓ Modular generation pipeline\n")
cat("✓ Parameter validation\n")
cat("✓ Metadata tracking\n")
```

```{r, fig.width=6.5}
generator$plot_time_series()
```

