Skip to contents
library(adaptNP)
library(dplyr)  # recommended for the examples
#> Warning: package 'dplyr' was built under R version 4.5.2
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union

# to add: get data
data = Esthwaite_Buoy_HiRes # pre-loaded data
criteria = '(Temp4m > 18) | (SPFD >800)'
flag_event(data,criteria)
#> # A tibble: 126,472 × 24
#>    TIMESTAMP           RECORD AirTemp WindDir WindSpd  CMP6    SPFD PonselTemp
#>    <dttm>               <dbl>   <dbl>   <dbl>   <dbl> <dbl>   <dbl>      <dbl>
#>  1 2025-04-29 21:06:00      0    12.9    55.7    0        0  0.0253       14.7
#>  2 2025-04-29 21:08:00      1    12.9    61.7    1.87     0  0.0126       14.7
#>  3 2025-04-29 21:10:00      2    12.8    39.9    1.88     0  0.0379       14.7
#>  4 2025-04-29 21:12:00      3    12.6    43.1    1.47     0  0.0442       14.7
#>  5 2025-04-29 21:14:00      4    12.8    55.8    1.59     0  0.0506       14.7
#>  6 2025-04-29 21:16:00      5    12.7    66.6    1.69     0  0.0379       14.7
#>  7 2025-04-29 21:18:00      6    12.6    63.2    1.80     0  0.0569       14.7
#>  8 2025-04-29 21:20:00      7    12.5    63.0    2.01     0 -0.0126       14.7
#>  9 2025-04-29 21:22:00      8    12.4    63.0    2.04     0  0.0442       14.7
#> 10 2025-04-29 21:26:00      0    12.3    59.1    0        0  0.0316       14.7
#> # ℹ 126,462 more rows
#> # ℹ 16 more variables: PonselCond <dbl>, Temp_RH <dbl>, RH <dbl>, Temp1m <dbl>,
#> #   Temp2m <dbl>, Temp3m <dbl>, Temp4m <dbl>, Temp5m <dbl>, Temp6m <dbl>,
#> #   Temp7m <dbl>, Temp8m <dbl>, Temp9m <dbl>, Temp10m <dbl>, Temp11m <dbl>,
#> #   Temp12m <dbl>, event_flag <lgl>