Skip to content

Commit c53cbd1

Browse files
committed
In layer logic coefficient names, typeset both ~"1" and ~1 as 1.
1 parent e428c3a commit c53cbd1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

R/InitErgmTerm.multilayer.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,9 @@ ergm_LayerLogic.list <- function(x, namemap = NULL, ...) {
677677
#' @param ... Additional arguments, currently unused.
678678
#' @export
679679
toString.ergm_LayerLogic <- function(x, ...) {
680-
despace(deparse1(if (length(x) == 2) x[[2]] else x))
680+
if (length(x) == 2) x <- x[[2]]
681+
if (is.character(x) && length(x) == 1L) x <- as.name(x) # Solitary layer name.
682+
despace(deparse1(x))
681683
}
682684

683685
# Substitute numeric layer IDs for layer names and simplify some common trivial expressions (e.g., a | a => a).

0 commit comments

Comments
 (0)