library(actR)
  library(lipdR)
  library(dplyr)
#> 
#> 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
#Get some data from the 4.2 paper
googlesheets4::gs4_deauth()
sites <- googlesheets4::read_sheet("1ReehV_sHCOwMalaFE_5NJyANEPih_nT0tBIQO1IeHak")
#>  Reading from North Atlantic 8.2 datasets.
#>  Range tp.

#download the corresponding data
northAtlanticData <- readLipd(sites$datasetId)
#> Getting version information from lipdverse
#>  ■■■                                5% |  ETA: 34s
#>  ■■■■■                             14% |  ETA: 31s
#>  ■■■■■■■■                          23% |  ETA: 28s
#>  ■■■■■■■■■■                        30% |  ETA: 26s
#>  ■■■■■■■■■■■■■                     39% |  ETA: 22s
#>  ■■■■■■■■■■■■■■■                   46% |  ETA: 20s
#>  ■■■■■■■■■■■■■■■■■■                55% |  ETA: 16s
#>  ■■■■■■■■■■■■■■■■■■■■              62% |  ETA: 16s
#>  ■■■■■■■■■■■■■■■■■■■■■             68% |  ETA: 14s
#>  ■■■■■■■■■■■■■■■■■■■■■■■■          77% |  ETA: 10s
#>  ■■■■■■■■■■■■■■■■■■■■■■■■■■■       86% |  ETA:  6s
#>  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■     95% |  ETA:  2s
#> Downloading 56 datasets from lipdverse.org...
#> [1] "Loading 56 datasets from /tmp/RtmptalLIV/lpdDownload..."
#>   |                                                                              |                                                                      |   0%  |                                                                              |=                                                                     |   2%  |                                                                              |==                                                                    |   4%  |                                                                              |====                                                                  |   5%  |                                                                              |=====                                                                 |   7%  |                                                                              |======                                                                |   9%  |                                                                              |========                                                              |  11%  |                                                                              |=========                                                             |  12%  |                                                                              |==========                                                            |  14%  |                                                                              |===========                                                           |  16%  |                                                                              |============                                                          |  18%  |                                                                              |==============                                                        |  20%  |                                                                              |===============                                                       |  21%  |                                                                              |================                                                      |  23%  |                                                                              |==================                                                    |  25%  |                                                                              |===================                                                   |  27%  |                                                                              |====================                                                  |  29%  |                                                                              |=====================                                                 |  30%  |                                                                              |======================                                                |  32%  |                                                                              |========================                                              |  34%  |                                                                              |=========================                                             |  36%  |                                                                              |==========================                                            |  38%  |                                                                              |============================                                          |  39%  |                                                                              |=============================                                         |  41%  |                                                                              |==============================                                        |  43%  |                                                                              |===============================                                       |  45%  |                                                                              |================================                                      |  46%  |                                                                              |==================================                                    |  48%  |                                                                              |===================================                                   |  50%  |                                                                              |====================================                                  |  52%  |                                                                              |======================================                                |  54%  |                                                                              |=======================================                               |  55%  |                                                                              |========================================                              |  57%  |                                                                              |=========================================                             |  59%  |                                                                              |==========================================                            |  61%  |                                                                              |============================================                          |  62%  |                                                                              |=============================================                         |  64%  |                                                                              |==============================================                        |  66%  |                                                                              |================================================                      |  68%  |                                                                              |=================================================                     |  70%  |                                                                              |==================================================                    |  71%  |                                                                              |===================================================                   |  73%  |                                                                              |====================================================                  |  75%  |                                                                              |======================================================                |  77%  |                                                                              |=======================================================               |  79%  |                                                                              |========================================================              |  80%  |                                                                              |==========================================================            |  82%  |                                                                              |===========================================================           |  84%  |                                                                              |============================================================          |  86%  |                                                                              |=============================================================         |  88%  |                                                                              |==============================================================        |  89%  |                                                                              |================================================================      |  91%  |                                                                              |=================================================================     |  93%  |                                                                              |==================================================================    |  95%  |                                                                              |====================================================================  |  96%  |                                                                              |===================================================================== |  98%  |                                                                              |======================================================================| 100%
#> 
#> [1] "Successfully loaded 56 datasets, with 0 failure(s)."

#create a timeseries tibble
nats <- as.lipdTsTibble(northAtlanticData)

#filter down to just the data we want
filtNats <- nats |> 
filter(paleoData_TSid %in% sites$paleoData_TSid)
#look for the 8.2 ka event at these sites:

tp <- split(filtNats,seq(nrow(filtNats)))


test <- detectExcursion(tp[[1]],
                  event.yr = 8200,
                  event.window = rnorm(50,400,100),
                  ref.window = rnorm(50,400,100),
                  exc.type = "negative",
                  n.ens = 50,
                  sig.num = rnorm(50,2,.1),
                  n.consecutive = sample(c(2,3,4),size = 50,replace = TRUE),
                  null.hypothesis.n = 50,
                  simulate.time.uncertainty = FALSE,
                  simulate.paleo.uncertainty = TRUE,
                  paleo.uncertainty = 0.2,
                  min.vals = 4,
                  paleo.ar1 = 0.8)
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■

events8.2 <- purrr::map(tp,
                  detectExcursion,
                  event.yr = 8200,
                  event.window = rnorm(50,400,100),
                  ref.window = rnorm(50,400,100),
                  exc.type = "negative",
                  n.ens = 50,
                  sig.num = rnorm(50,2,.1),
                  n.consecutive = sample(c(2,3,4),size = 50,replace = TRUE),
                  null.hypothesis.n = 50,
                  simulate.time.uncertainty = FALSE,
                  simulate.paleo.uncertainty = TRUE,
                  paleo.uncertainty = 0.2,
                  min.vals = 4,
                  paleo.ar1 = 0.8,
                  .progress = TRUE) |> 
  purrr::list_rbind() |> 
  dplyr::filter(!is.na(pvalue))
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■ 
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■                             12% |  ETA: 16m
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■                             12% |  ETA: 16mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■                             12% |  ETA: 16m ■■■■■■                            16% |  ETA: 15m
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■                            16% |  ETA: 15mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■                            16% |  ETA: 15mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■                            16% |  ETA: 15m ■■■■■■■                           21% |  ETA: 14m
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■                           21% |  ETA: 14m ■■■■■■■■                          23% |  ETA: 14m
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■                          23% |  ETA: 14mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■                          23% |  ETA: 14m ■■■■■■■■■■                        29% |  ETA: 12m
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■                        29% |  ETA: 12mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■                        29% |  ETA: 12mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■                        29% |  ETA: 12mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■                        29% |  ETA: 12mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■                        29% |  ETA: 12mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■                        29% |  ETA: 12mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■                        29% |  ETA: 12mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■                        29% |  ETA: 12mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■                        29% |  ETA: 12mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■                        29% |  ETA: 12mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■                        29% |  ETA: 12mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■                        29% |  ETA: 12mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■                        29% |  ETA: 12mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■                        29% |  ETA: 12mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■                        29% |  ETA: 12mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■                        29% |  ETA: 12mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■                        29% |  ETA: 12mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■                        29% |  ETA: 12m ■■■■■■■■■■■■■■■■■■■■■             66% |  ETA:  5m
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■■■■■■■■■■■■             66% |  ETA:  5mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■■■■■■■■■■■■             66% |  ETA:  5mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■■■■■■■■■■■■             66% |  ETA:  5mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■■■■■■■■■■■■             66% |  ETA:  5mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■■■■■■■■■■■■             66% |  ETA:  5mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■■■■■■■■■■■■             66% |  ETA:  5mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■■■■■■■■■■■■             66% |  ETA:  5m ■■■■■■■■■■■■■■■■■■■■■■■■■         80% |  ETA:  3m
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■■■■■■■■■■■■■■■■         80% |  ETA:  3mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■■■■■■■■■■■■■■■■         80% |  ETA:  3mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■■■■■■■■■■■■■■■■         80% |  ETA:  3mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■■■■■■■■■■■■■■■■         80% |  ETA:  3mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■■■■■■■■■■■■■■■■         80% |  ETA:  3mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■■■■■■■■■■■■■■■■         80% |  ETA:  3mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■■■■■■■■■■■■■■■■         80% |  ETA:  3mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■■■■■■■■■■■■■■■■         80% |  ETA:  3mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■■■■■■■■■■■■■■■■         80% |  ETA:  3mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■■■■■■■■■■■■■■■■         80% |  ETA:  3mTesting null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#> Testing null hypothesis with 50 simulations, each with 50 ensemble members. ■■■
#>  ■■■■■■■■■■■■■■■■■■■■■■■■■         80% |  ETA:  3m

lon.range <- range(events8.2$geo_longitude) + c(-5,5)
lat.range <- range(events8.2$geo_latitude) + c(-5,5)

dist.grid <- distanceGrid(events8.2,lon.range = lon.range,lat.range = lat.range,grid.resolution = 3)


pval.grid.weight.temp <- map(dist.grid,
                             spatialSigTest,
                             events=events8.2,
                             agg.method="robustNull",
                             use.weights = TRUE,
                             distance.cutoff = 1000,
                             .progress = TRUE)
#>  ■■■■■■■■■■■■■                     41% |  ETA:  5s
#>  ■■■■■■■■■■■■■■■■■■■■              62% |  ETA:  4s
#>  ■■■■■■■■■■■■■■■■■■■■■■■■■■        83% |  ETA:  2s

make a map!

    figoutTemp <- plotSignificance(pval.grid.weight.temp,
                                   sigTestResults = events8.2,
                               which.test = "pvalNeg",
                               color.breaks = c(0.01,0.05,0.1,0.2),
                               restrict.sites = TRUE,
                               alpha.by.weight = TRUE,
                               cutoff.distance = 1000,
                               x.lim = lon.range,
                               y.lim = lat.range)

figoutTemp$plot