-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apply not working on greta_array #514
Comments
Okay it just got weirder... because |
That sounds spooky! Let me check this out. |
Hi there, I'm looking into Wanted to apply the library(greta)
#>
#> Attaching package: 'greta'
#> The following objects are masked from 'package:stats':
#>
#> binomial, cov2cor, poisson
#> The following objects are masked from 'package:base':
#>
#> %*%, apply, backsolve, beta, chol2inv, colMeans, colSums, diag,
#> eigen, forwardsolve, gamma, identity, rowMeans, rowSums, sweep,
#> tapply
x <- normal(0, 10, dim = c(4, 5))
#> ℹ Initialising python and checking dependencies, this may take a moment.
#> ✔ Initialising python and checking dependencies ... done!
#>
apply(x, 1, mean) # doesn't work
#> Error in match.arg(FUN): 'arg' must be NULL or a character vector
apply(x, 1, "mean") # works
#> greta array (operation)
#>
#> [,1]
#> [1,] ?
#> [2,] ?
#> [3,] ?
#> [4,] ?
apply(x, 2, sd) # doesn't work
#> Error in match.arg(FUN): 'arg' must be NULL or a character vector
apply(x, 2, "sd") # doesn't work too, but gives more informative error
#> Error in match.arg(FUN): 'arg' should be one of "sum", "max", "mean", "min", "prod", "cumsum", "cumprod"
apply(x, 2, cumsum) # doesn't work
#> Error in match.arg(FUN): 'arg' must be NULL or a character vector
apply(x, 2, "cumsum") # supposed to work according to error message above, but doesn't
#> greta array (operation)
#>
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] NA NA NA NA NA
#> [2,] NA NA NA NA NA
#> [3,] NA NA NA NA NA
#> [4,] NA NA NA NA NA Created on 2022-12-19 with reprex v2.0.2 |
Hi, I bumped into this weird problem today... hopefully there is a quick fix or I was just doing something wrong.
Working on Ubuntu and
greta_0.4.2
.The text was updated successfully, but these errors were encountered: