Learn R Programming

dagitty (version 0.1-9)

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 class 'dagitty':
names(x)

Arguments

x
the input graph, of any type.

Examples

Run this code
## A "DAG" with Romanian and Portuguese variable names. These can be
## input using quotes to overcome the limitations on unquoted identifiers.
g <- dagitty( 'digraph {
  "coração" [pos="0.297,0.502"]
  "inimă" [pos="0.482,0.387"]
  "coração" -> "inimă"
}' )
names( g )

Run the code above in your browser using DataLab