gmean_sum | R Documentation |

Computes the geometric mean(s) of a numeric vector, matrix or data.frame

```
gmean_sum(x, margin = NULL)
gmean(x, margin = NULL)
```

`x` |
matrix or data.frame with numeric entries |

`margin` |
a vector giving the subscripts which the function will be applied over, 1 indicates rows, 2 indicates columns, 3 indicates all values. |

`gmean_sum`

calculates the totals based on geometric means while `gmean`

calculates geometric means on rows (margin = 1), on columns (margin = 2), or on all values (margin = 3)

geometric means (if `gmean`

is used) or totals (if `gmean_sum`

is used)

Matthias Templ

```
data("precipitation")
gmean_sum(precipitation)
gmean_sum(precipitation, margin = 2)
gmean_sum(precipitation, margin = 1)
gmean_sum(precipitation, margin = 3)
addmargins(precipitation)
addmargins(precipitation, FUN = gmean_sum)
addmargins(precipitation, FUN = mean)
addmargins(precipitation, FUN = gmean)
data("arcticLake", package = "robCompositions")
gmean(arcticLake$sand)
gmean(as.numeric(arcticLake[1, ]))
gmean(arcticLake)
gmean(arcticLake, margin = 1)
gmean(arcticLake, margin = 2)
gmean(arcticLake, margin = 3)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.