library(dplyr, warn.conflicts = FALSE)
glimpse(faithful)
#> Rows: 272
#> Columns: 2
#> $ eruptions <dbl> 3.600, 1.800, 3.333, 2.283, 4.533, 2.883, 4.700, 3.600, 1.95…
#> $ waiting <dbl> 79, 54, 74, 62, 85, 55, 88, 85, 51, 85, 54, 84, 78, 47, 83, …
# Using a single summary function in summarize(), not adding across().
This R code demonstrates ways to explore and get data from the WFS service for synoptic observations from the RMI Catalog at https://opendata.meteo.be.
See https://inbo.github.io/inbospatial/articles/wfs_wcs.html and https://inbo.github.io/tutorials/tutorials/spatial_wfs_services/ for more inspiration.
library(sf)
#> Linking to GEOS 3.11.1, GDAL 3.6.4, PROJ 9.1.1; sf_use_s2() is TRUE
library(dplyr, warn.conflicts = FALSE)
library(lubridate, warn.conflicts = FALSE)
library(tidyr)
library(qgisprocess)
#> Using 'qgis_process' in the system PATH.
#> QGIS version: 3.26.2-Buenos Aires
#> Configuration loaded from '~/.cache/R-qgisprocess/cache-0.0.0.9000.rds'
#> Run `qgis_configure(use_cached_data = TRUE)` to reload cache and get more details.
#> >>> If you need another installed QGIS version, run `qgis_configure()`;
#> see its documentation if you need to preset the path of qgis_process.
#> - Using JSON for input serialization.
#> - Using JSON for output serialization.
When aggregating groups of observations, depending on the objective, one usually wants to represent both the within-group and the between-group uncertainty, resulting in the total variance of the target variable (ind
in below examples).
In applying the referred formula for the specific case of equal-sized groups, it can be asked whether the group indices j and the group-member indices i can be switched, i.e. considering i = 1 as group 1, i = 2 as group 2 etc., hence flipping the order of aggregating.
In the first revision of this gist it was concluded that this was the case, i.e. that indices can be flipped. However the example had quite stringent conditions, such as (A) max(i) = max(j) and (B) a fixed within-group variance. From below experiments, it can be seen that index flipping can still be done when either A or B or relaxed. However when both are relaxed, it is no longer true. In that case the difference between both total variances