OK, here's what I came up with, comments after reprex
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(tibble))
# aggiter
aggiter <- list(structure(list(
x1 =
c(0.897102, 0.926416, 0.938169, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.941771, 0.941771, 0.941771, 0.941771, 0.941771, 0.941771, 0.941025, 0.85703, NA),
x2 =
c(0.683423, 0.789996, 0.833832, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.793072, 0.85667, 0.85667, 0.85667, 0.85667, 0.85667, 0.85667, 0.85703, 0.85703, NA),
x3 =
c(0.681053, 0.788475, 0.832662, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.78978, 0.85703, NA),
a =
c(0.3, 0.681053, 0.789996, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832, 0.833832),
b =
c(0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.95, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.943873, 0.941771, 0.85703, 0.85703)),
row.names =
c(NA, -45L),
class =
c("tbl_df", "tbl", "data.frame")), structure(list(
x1 =
c(0.797041, 0.851597, 0.874718, 0.861926, 0.874718, 0.874718, NA),
x2 =
c(0.627584, 0.732504, 0.7771, 0.786855, 0.708586, 0.708586, NA),
x3 =
c(0.626078, 0.731444, 0.776231, 0.78617, 0.706107, 0.706107, NA),
a =
c(0.3, 0.627584, 0.732504, 0.732504, 0.78617, 0.78617, 0.78617),
b =
c(0.95, 0.95, 0.95, 0.874718, 0.874718, 0.874718, 0.874718)),
row.names =
c(NA, -7L),
class =
c("tbl_df", "tbl", "data.frame")))
# function for two element list of tibbles to perform binary argument
# operator functions on corresponding column rows
f <- function(x,y,z){
first_tib <- x[1]
second_tib <- x[2]
colno <- y[1]
rowno <- y[2]
operand_one <- first_tib[[1]][colno,rowno]
operand_two <- second_tib[[1]][colno,rowno]
z(operand_one[[1]],operand_two[[1]])
}
f(aggiter,c(3,3),sum)
#> [1] 1.608893
f(aggiter,c(3,3),mean)
#> [1] 0.832662
Created on 2020-03-30 by the reprex package (v0.3.0)
This suffers, of course, from being too hardwired to the immediate problem. Its primary virtue is to lift the bracketing burden. There's an underlying burden that this doesn't address, which the necessity of digging the bare numbers out of a subset of a tibble in a list. (Because until getting down to the bare numeric, there is no guarantee that binary functions will work; some, like sum don't mind; others, like mean do.)
There's also the nuisance of namespace clutter with the mass of temporary objects
c("a", "aggiter", "aggnai", "b", "c11", "c12", "c13", "c1star", "c21", "c22", "c23", "c2star", "c31", "c32", "c33", "c3star", "D", "i", "iteration", "maxw", "minw", "na", "na1", "na2", "na3", "proba1", "proba2", "proba3", "probg", "probi", "probn1", "probn2", "probn3", "reset", "ruling", "rulings", "specimen", "t", "w1", "w2", "w3", "wbar", "x", "x1", "x11", "x12", "x13", "x2", "x21", "x22", "x23", "x3", "x31", "x32", "x33", "xstar")
#> [1] "a" "aggiter" "aggnai" "b" "c11" "c12"
#> [7] "c13" "c1star" "c21" "c22" "c23" "c2star"
#> [13] "c31" "c32" "c33" "c3star" "D" "i"
#> [19] "iteration" "maxw" "minw" "na" "na1" "na2"
#> [25] "na3" "proba1" "proba2" "proba3" "probg" "probi"
#> [31] "probn1" "probn2" "probn3" "reset" "ruling" "rulings"
#> [37] "specimen" "t" "w1" "w2" "w3" "wbar"
#> [43] "x" "x1" "x11" "x12" "x13" "x2"
#> [49] "x21" "x22" "x23" "x3" "x31" "x32"
#> [55] "x33" "xstar"
Created on 2020-03-30 by the reprex package (v0.3.0)
(all of them except for my mini-dput function specimen).
The reason that the crowded namespace is problematic comes from the nature of R as an interactive environment. What should be given consideration may seem like working backwards: First design the object structure that is easy to map functions to, then work backwards to populate it.