datalib icon indicating copy to clipboard operation
datalib copied to clipboard

aggregate: geometric mean?

Open jowens opened this issue 9 years ago • 2 comments

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

jowens avatar Jan 16 '16 23:01 jowens

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))" }
]

g3o2 avatar Oct 14 '16 16:10 g3o2

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/

jowens avatar May 06 '23 01:05 jowens