greta-dev / greta-dev/greta

sd() on greta_array does not return a greta_array

Open
#504 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
607
Forks
67
Avg merge
3d 8h
Merged PRs (30d)
1

Description

Hi there, with the code below, applying `sd()` on a `greta_array` does not return the same class. Just wondering if it's intentional?

```
library(greta)
x <- normal(0, 1, dim = 10)
sd(x) # class numeric
mean(x) # class greta_array
```

I'm want to generate some calculated quantities by scaling using `sd(x)` so it'd be nice if it returns a `greta_array`. I could use `var(x)` or `scale(x)` (both return `greta_array`) but they are clunky in their own ways...

This was using `greta_0.4.1.9000` on `R version 4.1.3 (2022-03-10)`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.