Skip to content

sd() on greta_array does not return a greta_array #504

@hrlai

Description

@hrlai

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions