# find_min_before_hours function

# find_min_before_hours

Runs the documented examples for `find_min_before_hours()`.

    example(find_min_before_hours, package = "cgmguru", run.dontrun = FALSE)
    #>
    #> fnd___> # Load sample data
    #> fnd___> library(iglu)
    #>
    #> fnd___> data(example_data_5_subject)
    #>
    #> fnd___> data(example_data_hall)
    #>
    #> fnd___> # Create start points for demonstration (using row indices)
    #> fnd___> start_indices <- seq(1, nrow(example_data_5_subject), by = 100)
    #>
    #> fnd___> start_points <- data.frame(start_indices = start_indices)
    #>
    #> fnd___> # Find minimum glucose in previous 2 hours
    #> fnd___> min_before <- find_min_before_hours(example_data_5_subject, start_points, hours = 2)
    #>
    #> fnd___> print(paste("Found", length(min_before$min_indices), "minimum points"))
    #> [1] "Found 1 minimum points"
    #>
    #> fnd___> # Find minimum glucose in previous 1 hour
    #> fnd___> min_before_1h <- find_min_before_hours(example_data_5_subject, start_points, hours = 1)
    #>
    #> fnd___> # Analysis on larger dataset
    #> fnd___> large_start_indices <- seq(1, nrow(example_data_hall), by = 200)
    #>
    #> fnd___> large_start_points <- data.frame(start_indices = large_start_indices)
    #>
    #> fnd___> large_min_before <- find_min_before_hours(example_data_hall, large_start_points, hours = 2)
    #>
    #> fnd___> print(paste("Found", length(large_min_before$min_indices), "minimum points in larger dataset"))
    #> [1] "Found 1 minimum points in larger dataset"