diff --git a/R/get.node.attr.R b/R/get.node.attr.R index 1222e053a..5418e2abc 100644 --- a/R/get.node.attr.R +++ b/R/get.node.attr.R @@ -231,6 +231,12 @@ get.node.attr <- function(nw, attrname, functionname=NULL, numeric=FALSE) { #' # Select via an index of a cell: #' idx <- cbind(1,2) #' summary(faux.mesa.high~mm("Sex", levels2=idx)) +#' # Or, select by specific attribute value combinations, though note +#' # the names 'row' and 'col' and the order for undirected networks: +#' summary(faux.mesa.high~mm("Sex", +#' levels2 = I(list(list(row="M",col="M"), +#' list(row="M",col="F"), +#' list(row="F",col="M"))))) #' #' # mm() term allows two-sided attribute formulas with different attributes: #' summary(faux.mesa.high~mm(Grade~Race, levels2=TRUE)) diff --git a/man/nodal_attributes.Rd b/man/nodal_attributes.Rd index 8f55ee46c..9c7135f57 100644 --- a/man/nodal_attributes.Rd +++ b/man/nodal_attributes.Rd @@ -195,6 +195,12 @@ summary(faux.mesa.high~mm("Sex", levels2=M)+mm("Sex", levels2=t(M))) # Select via an index of a cell: idx <- cbind(1,2) summary(faux.mesa.high~mm("Sex", levels2=idx)) +# Or, select by specific attribute value combinations, though note +# the names 'row' and 'col' and the order for undirected networks: +summary(faux.mesa.high~mm("Sex", + levels2 = I(list(list(row="M",col="M"), + list(row="M",col="F"), + list(row="F",col="M"))))) # mm() term allows two-sided attribute formulas with different attributes: summary(faux.mesa.high~mm(Grade~Race, levels2=TRUE)) diff --git a/vignettes/nodal_attributes.Rmd b/vignettes/nodal_attributes.Rmd index 06a1a3908..59cb02f08 100644 --- a/vignettes/nodal_attributes.Rmd +++ b/vignettes/nodal_attributes.Rmd @@ -192,6 +192,12 @@ summary(faux.mesa.high~mm("Sex", levels2=M)+mm("Sex", levels2=t(M))) # Select via an index of a cell: idx <- cbind(1,2) summary(faux.mesa.high~mm("Sex", levels2=idx)) +# Or, select by specific attribute value combinations, though note the +# names 'row' and 'col' and the order for undirected networks: +summary(faux.mesa.high~mm("Sex", + levels2 = I(list(list(row="M",col="M"), + list(row="M",col="F"), + list(row="F",col="M"))))) ``` The attributes of the `mm()` term can be a two-sided formula with different attributes: