Skip to content

Commit 37ff404

Browse files
Copilotosorensen
andcommitted
Fix code review issues: dynamic header length and consistent spacing
Co-authored-by: osorensen <21175639+osorensen@users.noreply.github.com>
1 parent 16a8de8 commit 37ff404

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

R/print.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ print.BayesMallowsSMC2 <- function(x, ...) {
5050

5151
# Create header
5252
cat("BayesMallowsSMC2 Model\n")
53-
cat(strrep("=", 23), "\n\n", sep = "")
53+
cat(strrep("=", nchar("BayesMallowsSMC2 Model")), "\n\n", sep = "")
5454

5555
# Display basic information
5656
cat("Number of particles: ", n_particles, "\n", sep = "")
@@ -59,9 +59,9 @@ print.BayesMallowsSMC2 <- function(x, ...) {
5959
cat("Number of clusters: ", n_clusters, "\n\n", sep = "")
6060

6161
# Display model fit information
62-
cat("Log marginal likelihood:", sprintf("%.2f", x$log_marginal_likelihood), "\n")
63-
cat("Final ESS: ", sprintf("%.2f", x$ESS[n_timepoints]), "\n")
64-
cat("Resampling events: ", n_resampling_events, "/", n_timepoints, "\n", sep = "")
62+
cat("Log marginal likelihood: ", sprintf("%.2f", x$log_marginal_likelihood), "\n", sep = "")
63+
cat("Final ESS: ", sprintf("%.2f", x$ESS[n_timepoints]), "\n", sep = "")
64+
cat("Resampling events: ", n_resampling_events, "/", n_timepoints, "\n", sep = "")
6565

6666
invisible(x)
6767
}

0 commit comments

Comments
 (0)