Skip to content

Call as.array on input to prepare_mcmc_array() #184

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

Merged
merged 4 commits into from
May 2, 2019
Merged

Conversation

jgabry
Copy link
Member

@jgabry jgabry commented Apr 18, 2019

Closes #175.

As suggested by @bgoodri, with this PR objects with as.array methods can now be passed to the MCMC plots (not the PPC plots) without the user having to call as.array. For example,

fit <- stan_glm(mpg ~ wt, data = mtcars)

# these give the same result now
mcmc_hist(fit)
mcmc_hist(as.array(fit))

If the resulting array doesn't have 2 or 3 dimensions an error is thrown.

@jgabry jgabry added the feature label Apr 18, 2019
@jgabry
Copy link
Member Author

jgabry commented Apr 18, 2019

Note: this is small PR. It says 14 files changed only because I changed the doc in one of the roxygen templates and that affects many Rd files.

@jgabry jgabry requested a review from tjmahr April 18, 2019 19:34
[ci skip]
Copy link
Collaborator

@tjmahr tjmahr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. The warnings raised during my local testing environment were not related to these changes (they are from new deprecations in other packages).

@tjmahr tjmahr merged commit bfe5c66 into master May 2, 2019
@tjmahr tjmahr deleted the coerce-to-array branch May 2, 2019 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Always call as.matrix or as.array on the first argument
2 participants