Skip to content
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

unnest_rvars() broken with matrix covariates #316

Closed
wds15 opened this issue Aug 29, 2023 · 1 comment
Closed

unnest_rvars() broken with matrix covariates #316

wds15 opened this issue Aug 29, 2023 · 1 comment

Comments

@wds15
Copy link

wds15 commented Aug 29, 2023

unnest_rvars is broken with matrix covariates in a tibble (or data.frame):

df <- tibble::tibble(regimen=1:3, dose_time=matrix(1:3, 3, 3), pp=posterior::rvar(rnorm(3)))

## does not work:
df |> tidybayes::unnest_rvars()
#> Error in data.frame(..., check.names = FALSE): arguments imply differing number of rows: 1, 3

## ok
df |> dplyr::select(-dose_time) |> tidybayes::unnest_rvars()
#> # A tibble: 9 × 5
#> # Groups:   regimen [3]
#>   regimen      pp .chain .iteration .draw
#>     <int>   <dbl>  <int>      <int> <int>
#> 1       1  0.124       1          1     1
#> 2       1 -0.398       1          2     2
#> 3       1  0.0752      1          3     3
#> 4       2  0.124       1          1     1
#> 5       2 -0.398       1          2     2
#> 6       2  0.0752      1          3     3
#> 7       3  0.124       1          1     1
#> 8       3 -0.398       1          2     2
#> 9       3  0.0752      1          3     3

Created on 2023-08-29 with reprex v2.0.2

@mjskay mjskay closed this as completed in b9f8517 Sep 3, 2023
@mjskay
Copy link
Owner

mjskay commented Sep 3, 2023

Thanks! Should be fixed in the github version now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants