datalib
datalib copied to clipboard
aggregate: geometric mean?
Could you support a geometric-mean? I see "avg", which I assume is an arithmetic mean, and you have "median". I know I'll need geomean in the not too distant future.
https://github.com/vega/vega-lite/issues/575
In the meantime, you can use the pow function, for example:
"transform": [
{ "type": "calculate", "field": "aagr", "expr": "pow((datum.value1 * datum.value2 * datum.value3), (1 / 3))" }
]
7+ years later, I asked in Altair Slack (today) and rediscovered this post. Anyway, geom didn't seem to make it into vega (sadly).
https://vega.github.io/vega/docs/transforms/aggregate/