dagitty (version 0.2-2)

names.dagitty: Names of Variables in Graph

Description

Extracts the variable names from an input graph. Useful for iterating over all variables.

Usage

# S3 method for dagitty
names(x)

Arguments

x

the input graph, of any type.

Examples

Run this code
# NOT RUN {
## A "DAG" with Romanian and Swedish variable names. These can be
## input using quotes to overcome the limitations on unquoted identifiers.
g <- dagitty( 'digraph {
  "cora<U+00E7><U+00E3>o" [pos="0.297,0.502"]
  "hj<U+00E4>rta" [pos="0.482,0.387"]
  "cora<U+00E7><U+00E3>o" -> "hj<U+00E4>rta"
}' )
names( g )
# }

Run the code above in your browser using DataLab