diff options
author | Ken Kellner <ken@kenkellner.com> | 2021-06-17 08:37:19 -0400 |
---|---|---|
committer | Ken Kellner <ken@kenkellner.com> | 2021-06-17 08:39:28 -0400 |
commit | d3de26f380b58fce639c5514629ae76e6216fa27 (patch) | |
tree | bd11077e527c05bc245b8bf0d80e165e70d5c84d | |
parent | da4dce5de4ea8cb2f5bcb3cdd4a8903ed43c36e4 (diff) |
Put Rhat value in title of traceplots
-rw-r--r-- | DESCRIPTION | 4 | ||||
-rw-r--r-- | R/traceplot.R | 12 |
2 files changed, 4 insertions, 12 deletions
diff --git a/DESCRIPTION b/DESCRIPTION index 3777163..17ed108 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: jagsUI -Version: 1.5.1.9105 -Date: 2021-06-16 +Version: 1.5.1.9106 +Date: 2021-06-17 Title: A Wrapper Around 'rjags' to Streamline 'JAGS' Analyses Authors@R: c( person("Ken", "Kellner", email="contact@kenkellner.com", role=c("cre","aut")), diff --git a/R/traceplot.R b/R/traceplot.R index 212b038..4a7c8bd 100644 --- a/R/traceplot.R +++ b/R/traceplot.R @@ -32,15 +32,7 @@ param_trace <- function(x, parameter, m_labels=FALSE){ cols <- grDevices::rainbow(ncol(vals)) graphics::matplot(1:nrow(vals), vals, type='l', lty=1, col=cols, xlab='Iterations', ylab='Value', - main=paste('Trace of',parameter)) - # graphics::plot(1:nrow(vals), vals[,1], type='l', col=cols[1], - # ylim=range(vals), xlab='Iterations', ylab='Value', - # main=paste('Trace of',parameter)) - # for (i in 2:ncol(vals)) graphics::lines(1:nrow(vals), vals[,i], col=cols[i]) # this fails with 1 chain - - #Add Rhat value - graphics::legend('bottomright', legend=bquote(hat(R) == .(Rhat)), - bty='o', bg='white', cex=1.2) + main=bquote(.(parameter)*","~hat(R) == .(Rhat))) #Add margin labels if necessary if(m_labels){ @@ -50,4 +42,4 @@ param_trace <- function(x, parameter, m_labels=FALSE){ } #General function for setting up plots -# get_plot_info now has its own file
\ No newline at end of file +# get_plot_info now has its own file |