You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you put a greta array inside a tibble, it has a funky print method
a greta array inside a tibble can be pulled out and is still a greta array
a greta array in a data.frame prints NA
a greta array inside data.frame gets its class stripped off of it
library(tibble)
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,#> tapplyihr_car_ratio<-greta::uniform(0,1)
#> ℹ Initialising python and checking dependencies, this may take a moment.#> ✔ Initialising python and checking dependencies ... done!#> ihr_car_ratio#> greta array (variable following a uniform distribution)#> #> [,1]#> [1,] ?greta_tbl<- tibble(
x=1:5,
car_ratio=ihr_car_ratio
)
greta_df<-data.frame(
x=1:5,
car_ratio=ihr_car_ratio
)
greta_tbl#> # A tibble: 5 × 2#> x car_ratio[,1] #> <int> <gret_rry[,1]>#> 1 1 NA #> 2 2 car_ratio[,1] #> 3 3 <gret_rry[,1]>#> 4 4 NA #> 5 5 car_ratio[,1]greta_df#> x car_ratio#> 1 1 NA#> 2 2 NA#> 3 3 NA#> 4 4 NA#> 5 5 NAgreta_tbl$car_ratio#> greta array (variable following a uniform distribution)#> #> [,1]#> [1,] ?greta_df$car_ratio#> [1] NA NA NA NA NA
This issue will require, I think, rewriting the greta array classes with a vctr class, https://vctrs.r-lib.org/articles/s3-vector.html, which overall I think might simplify some things, but will actually be a reasonably complex fix.
A few things:
Created on 2024-04-30 with reprex v2.1.0
Session info
The text was updated successfully, but these errors were encountered: