Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
can be set to FALSE to recover the old version of the plot. (#171, #235,
@ecoronado92)

* Fix error in `mcmc_acf()` for some input types. (#244, #245, @hhau)

# bayesplot 1.7.2

Expand Down
3 changes: 1 addition & 2 deletions R/mcmc-diagnostics.R
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,7 @@ acf_data <- function(x, lags) {
abort(paste0("Too few iterations for lags=", lags, "."))
}

data <- reshape2::melt(x, value.name = "Value")
data$Chain <- factor(data$Chain)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a reason to also get rid of making Chain a factor? To be honest I'm not sure why that was there in the first place (it may never have been necessary, maybe I thought tapply required factors), but curious if you removed that intentionally?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I removed it intentionally. I didn’t think it was necessary as tapply calls as.factor on INDEX anyway.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok that makes sense, thanks!

data <- melt_mcmc(x)
ac_list <- tapply(
data[["Value"]],
# INDEX = list(data[["Chain"]], data[["Parameter"]]),
Expand Down